SELECT 
  pfv.feature_id, 
  pfv.product_id, 
  pfv.variant_id, 
  gp.group_id 
FROM 
  cscart_product_features_values AS pfv 
  INNER JOIN cscart_product_variation_group_products AS gp ON pfv.product_id = gp.product_id 
  INNER JOIN cscart_product_variation_group_features AS gpf ON gpf.group_id = gp.group_id 
  AND gpf.feature_id = pfv.feature_id 
WHERE 
  pfv.lang_code = 'vi' 
  AND gp.group_id IN (
    16310, 16945, 15852, 12744, 15848, 16735, 
    12733, 16314, 16734, 16313, 17020, 
    14517, 17022, 17041, 16733, 14412, 
    16309, 13640, 17297
  )

Query time 0.00633

JSON explain

{
  "query_block": {
    "select_id": 1,
    "nested_loop": [
      {
        "table": {
          "table_name": "gp",
          "access_type": "range",
          "possible_keys": ["PRIMARY", "idx_group_id"],
          "key": "idx_group_id",
          "key_length": "3",
          "used_key_parts": ["group_id"],
          "rows": 87,
          "filtered": 100,
          "index_condition": "gp.group_id in (16310,16945,15852,12744,15848,16735,12733,16314,16734,16313,17020,14517,17022,17041,16733,14412,16309,13640,17297)"
        }
      },
      {
        "table": {
          "table_name": "gpf",
          "access_type": "ref",
          "possible_keys": ["PRIMARY", "idx_group_id"],
          "key": "idx_group_id",
          "key_length": "3",
          "used_key_parts": ["group_id"],
          "ref": ["dev_db.gp.group_id"],
          "rows": 1,
          "filtered": 100
        }
      },
      {
        "table": {
          "table_name": "pfv",
          "access_type": "ref",
          "possible_keys": [
            "PRIMARY",
            "fl",
            "lang_code",
            "product_id",
            "fpl",
            "idx_product_feature_variant_id"
          ],
          "key": "idx_product_feature_variant_id",
          "key_length": "12",
          "used_key_parts": ["product_id", "feature_id", "lang_code"],
          "ref": ["dev_db.gp.product_id", "dev_db.gpf.feature_id", "const"],
          "rows": 1,
          "filtered": 100,
          "attached_condition": "pfv.lang_code = 'vi'",
          "using_index": true
        }
      }
    ]
  }
}

Result

feature_id product_id variant_id group_id
20275 18285 70938 12733
20275 18284 70937 12733
20275 4385 70939 12733
20286 18307 70971 12744
20286 18306 70970 12744
20286 4374 70972 12744
21270 22010 74420 13640
21270 22009 74419 13640
21270 22008 74418 13640
21270 2048 74421 13640
22129 24788 77472 14412
22129 24787 77471 14412
22129 24786 77470 14412
22129 24785 77469 14412
22129 696 77473 14412
22237 542 77918 14517
22237 25160 77915 14517
22237 25161 77916 14517
22237 25162 77917 14517
23725 36521 82351 15848
23725 36653 82352 15848
23725 36654 82353 15848
23725 36655 82354 15848
23725 36656 82355 15848
23725 36657 82356 15848
23728 36293 82362 15852
23728 36679 82363 15852
23728 36680 82364 15852
23728 36681 82365 15852
23728 36682 82366 15852
23728 36683 82367 15852
24093 40531 83944 16309
24093 40561 83945 16309
24094 40532 83946 16310
24094 40562 83947 16310
24094 40563 83948 16310
24094 40564 83949 16310
24094 40565 83950 16310
24097 40582 83973 16313
24097 40581 83972 16313
24097 40534 83971 16313
24098 40584 83975 16314
24098 40583 83983 16314
24098 40529 83974 16314
24098 40586 83977 16314
24098 40589 83980 16314
24098 40587 83978 16314
24098 40590 83981 16314
24098 40591 83982 16314
24098 40588 83979 16314
24098 40585 83976 16314
24496 44570 85457 16733
24496 44578 85458 16733
24497 44571 85459 16734
24497 44579 85460 16734
24498 44573 85461 16735
24498 44592 85462 16735
24717 49308 86218 16945
24717 46818 86219 16945
24717 49309 86220 16945
24770 47257 86391 17020
24770 47288 86392 17020
24770 47289 86393 17020
24770 47290 86394 17020
24770 47291 86395 17020
24770 47292 86396 17020
24770 47293 86397 17020
24770 47294 86398 17020
24772 47298 86403 17022
24772 47299 86404 17022
24772 47300 86405 17022
24772 47297 86402 17022
24772 47258 86401 17022
24792 47411 86493 17041
24792 47393 86492 17041
25053 49773 87425 17297
25053 49758 87423 17297
25053 49772 87424 17297
25053 49775 87427 17297
25053 49776 87428 17297
25053 49774 87426 17297