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 = 'ar' 
  AND gp.group_id IN (
    31, 30, 29, 28, 8, 9, 10, 11, 12, 13, 14, 
    16, 17, 18, 19, 20, 21, 6, 3
  )

Query time 0.00097

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "56.71"
    },
    "nested_loop": [
      {
        "table": {
          "table_name": "gp",
          "access_type": "index",
          "possible_keys": [
            "PRIMARY",
            "idx_group_id"
          ],
          "key": "PRIMARY",
          "used_key_parts": [
            "product_id",
            "group_id"
          ],
          "key_length": "6",
          "rows_examined_per_scan": 190,
          "rows_produced_per_join": 53,
          "filtered": "27.89",
          "using_index": true,
          "cost_info": {
            "read_cost": "14.32",
            "eval_cost": "5.30",
            "prefix_cost": "19.62",
            "data_read_per_join": "848"
          },
          "used_columns": [
            "product_id",
            "group_id"
          ],
          "attached_condition": "(`betaatif_store`.`gp`.`group_id` in (31,30,29,28,8,9,10,11,12,13,14,16,17,18,19,20,21,6,3))"
        }
      },
      {
        "table": {
          "table_name": "gpf",
          "access_type": "ref",
          "possible_keys": [
            "PRIMARY",
            "idx_group_id"
          ],
          "key": "idx_group_id",
          "used_key_parts": [
            "group_id"
          ],
          "key_length": "3",
          "ref": [
            "betaatif_store.gp.group_id"
          ],
          "rows_examined_per_scan": 1,
          "rows_produced_per_join": 53,
          "filtered": "100.00",
          "cost_info": {
            "read_cost": "13.25",
            "eval_cost": "5.30",
            "prefix_cost": "38.17",
            "data_read_per_join": "5K"
          },
          "used_columns": [
            "feature_id",
            "group_id"
          ]
        }
      },
      {
        "table": {
          "table_name": "pfv",
          "access_type": "ref",
          "possible_keys": [
            "PRIMARY",
            "fl",
            "lang_code",
            "product_id",
            "fpl",
            "idx_product_feature_variant_id"
          ],
          "key": "fpl",
          "used_key_parts": [
            "feature_id",
            "product_id",
            "lang_code"
          ],
          "key_length": "12",
          "ref": [
            "betaatif_store.gpf.feature_id",
            "betaatif_store.gp.product_id",
            "const"
          ],
          "rows_examined_per_scan": 1,
          "rows_produced_per_join": 53,
          "filtered": "100.00",
          "cost_info": {
            "read_cost": "13.25",
            "eval_cost": "5.30",
            "prefix_cost": "56.72",
            "data_read_per_join": "40K"
          },
          "used_columns": [
            "feature_id",
            "product_id",
            "variant_id",
            "lang_code"
          ]
        }
      }
    ]
  }
}

Result

feature_id product_id variant_id group_id
2 124 12 3
2 378 8 3
2 379 9 3
2 391 8 6
2 393 12 6
2 394 9 6
2 401 9 8
2 402 6 9
2 404 9 9
2 406 6 10
2 408 9 10
2 409 6 11
2 411 9 11
2 412 6 12
2 414 9 12
2 415 6 13
2 417 9 13
2 418 6 14
2 420 9 14
2 424 6 16
2 426 9 16
2 427 6 17
2 429 9 17
2 430 6 18
2 432 9 18
2 433 6 19
2 435 9 19
2 436 6 20
2 438 9 20
2 439 6 21
2 441 9 21
2 442 7 21
2 443 7 20
2 444 7 19
2 445 7 18
2 446 7 17
2 447 7 16
2 448 7 14
2 449 7 13
2 450 7 12
2 451 7 11
2 452 7 10
2 453 7 9
2 454 6 8
2 455 7 8
2 480 6 28
2 481 7 28
2 482 9 28
2 483 11 28
2 484 6 29
2 485 7 29
2 486 9 29
2 487 11 29
2 488 6 30
2 489 7 30
2 490 9 30
2 491 11 30
2 492 6 31
2 493 7 31
2 494 9 31
2 495 11 31