SELECT 
  f.feature_id, 
  f.purpose, 
  p.product_id, 
  p.parent_product_id, 
  g.id, 
  g.code 
FROM 
  cscart_product_variation_group_features AS f 
  INNER JOIN cscart_product_variation_groups AS g ON f.group_id = g.id 
  INNER JOIN cscart_product_variation_group_products AS p ON f.group_id = p.group_id 
WHERE 
  p.product_id IN (
    313162, 313163, 313164, 313165, 313166, 
    313167, 313168, 313169, 313170, 313171, 
    313172, 313173, 313174, 313175, 313176, 
    313177, 313178, 313179, 313180, 313181, 
    313182, 313183, 313184, 313185, 313186, 
    313187, 313188, 313189, 313190, 313191, 
    313192, 313193, 313194, 313195, 313196, 
    313197, 313198, 313199, 313200, 313201, 
    313202, 313203, 313204, 313205, 313206, 
    313207, 313208, 313209, 313210, 313211, 
    313212, 313213, 313214, 313215, 313216, 
    313217, 313218, 313219, 313220, 313221, 
    313222, 313223, 313224, 313225, 313226, 
    313227, 313228, 313229, 313230, 312934, 
    313010, 313019, 313020, 313021, 313022, 
    313023, 313024, 313025, 313026, 313027, 
    313028, 313011, 313029, 313030, 313031, 
    313032, 313033, 313034, 313035, 313036, 
    313037, 313038, 313012, 313039, 313040, 
    313041
  )

Query time 0.00057

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost": 0.03140489,
    "nested_loop": [
      {
        "table": {
          "table_name": "g",
          "access_type": "index",
          "possible_keys": ["PRIMARY"],
          "key": "idx_group_code",
          "key_length": "387",
          "used_key_parts": ["code"],
          "loops": 1,
          "rows": 2,
          "cost": 0.00693929,
          "filtered": 100,
          "using_index": true
        }
      },
      {
        "table": {
          "table_name": "f",
          "access_type": "ref",
          "possible_keys": ["idx_group_id"],
          "key": "idx_group_id",
          "key_length": "3",
          "used_key_parts": ["group_id"],
          "ref": ["u985510652_ecartify.g.id"],
          "loops": 2,
          "rows": 1,
          "cost": 0.00527872,
          "filtered": 100
        }
      },
      {
        "table": {
          "table_name": "p",
          "access_type": "ref",
          "possible_keys": ["PRIMARY", "idx_group_id"],
          "key": "idx_group_id",
          "key_length": "3",
          "used_key_parts": ["group_id"],
          "ref": ["u985510652_ecartify.g.id"],
          "loops": 2,
          "rows": 8,
          "cost": 0.01918688,
          "filtered": 100,
          "index_condition": "p.product_id in (313162,313163,313164,313165,313166,313167,313168,313169,313170,313171,313172,313173,313174,313175,313176,313177,313178,313179,313180,313181,313182,313183,313184,313185,313186,313187,313188,313189,313190,313191,313192,313193,313194,313195,313196,313197,313198,313199,313200,313201,313202,313203,313204,313205,313206,313207,313208,313209,313210,313211,313212,313213,313214,313215,313216,313217,313218,313219,313220,313221,313222,313223,313224,313225,313226,313227,313228,313229,313230,312934,313010,313019,313020,313021,313022,313023,313024,313025,313026,313027,313028,313011,313029,313030,313031,313032,313033,313034,313035,313036,313037,313038,313012,313039,313040,313041)"
        }
      }
    ]
  }
}