SELECT 
  cscart_product_features_values.feature_id, 
  cscart_product_features_values.variant_id 
FROM 
  cscart_product_features_values 
  INNER JOIN cscart_products AS products ON products.product_id = cscart_product_features_values.product_id 
  LEFT JOIN cscart_product_features_values as var_val_18 ON var_val_18.product_id = products.product_id 
  AND var_val_18.lang_code = 'en' 
  AND var_val_18.feature_id = 18 
WHERE 
  cscart_product_features_values.feature_id IN (18, 548, 549, 3529, 3534, 3541, 3542) 
  AND products.parent_product_id = 0 
  AND products.status = 'A' 
  AND products.amount != 0 
  AND cscart_product_features_values.lang_code = 'en' 
  AND (
    var_val_18.variant_id IN (5181) 
    OR cscart_product_features_values.feature_id = 18
  ) 
GROUP BY 
  cscart_product_features_values.variant_id 
ORDER BY 
  NULL

Query time 0.35613

JSON explain

{
  "query_block": {
    "select_id": 1,
    "temporary_table": {
      "table": {
        "table_name": "products",
        "access_type": "index_merge",
        "possible_keys": ["PRIMARY", "status", "idx_parent_product_id"],
        "key_length": "3,4",
        "index_merge": {
          "intersect": {
            "range": {
              "key": "status",
              "used_key_parts": ["status"]
            },
            "range": {
              "key": "idx_parent_product_id",
              "used_key_parts": ["parent_product_id"]
            }
          }
        },
        "rows": 28991,
        "filtered": 100,
        "attached_condition": "products.parent_product_id = 0 and products.`status` = 'A' and products.amount <> 0"
      },
      "table": {
        "table_name": "var_val_18",
        "access_type": "ref",
        "possible_keys": [
          "PRIMARY",
          "fl",
          "lang_code",
          "product_id",
          "fpl",
          "idx_product_feature_variant_id"
        ],
        "key": "product_id",
        "key_length": "6",
        "used_key_parts": ["product_id", "feature_id"],
        "ref": ["staging2_wesave_com.products.product_id", "const"],
        "rows": 1,
        "filtered": 38.51078796,
        "attached_condition": "trigcond(var_val_18.lang_code = 'en')",
        "using_index": true
      },
      "table": {
        "table_name": "cscart_product_features_values",
        "access_type": "ref",
        "possible_keys": [
          "PRIMARY",
          "fl",
          "lang_code",
          "product_id",
          "fpl",
          "idx_product_feature_variant_id"
        ],
        "key": "product_id",
        "key_length": "3",
        "used_key_parts": ["product_id"],
        "ref": ["staging2_wesave_com.products.product_id"],
        "rows": 2,
        "filtered": 100,
        "attached_condition": "cscart_product_features_values.feature_id in (18,548,549,3529,3534,3541,3542) and cscart_product_features_values.lang_code = 'en' and (var_val_18.variant_id = 5181 or cscart_product_features_values.feature_id = 18)",
        "using_index": true
      }
    }
  }
}

Result

feature_id variant_id
18 293
18 576
18 648
18 838
18 3862
18 1112
18 1436
18 879
18 1080
18 3485
18 1551
18 1752
18 1898
18 1140
18 5166
18 3890
18 556
18 3521
18 3831
18 433
18 5167
18 367
18 5168
18 5169
18 1131
18 1128
18 1568
18 396
18 5170
18 5171
18 1009
18 1235
18 1799
18 1049
18 376
18 984
18 475
18 4569
18 428
18 3076
18 5173
18 5174
18 3498
18 5175
18 804
18 1181
18 5176
18 4029
18 2083
18 356
18 5177
18 2098
18 2059
18 796
18 5178
18 1447
18 5179
18 844
18 5180
18 5181
18 1887
18 1109
18 1073
18 515
18 1786
18 5182
18 411
18 895
18 5183
18 4725
18 5184
18 5185
18 1427
18 5186
18 4320
18 3153
18 1883
18 5187
18 5188
18 1085
18 5189
18 5190
18 5192
18 5193
18 5194
18 5191
18 488
18 700
18 5195
18 5196
18 5197
18 5198
18 1890
18 3361
18 3073
18 1480
18 2645
18 1156
18 5201
18 5202
18 5203
18 5200
18 5204
18 5205
18 1306
18 5206
18 5199
18 3146
18 4401
18 1162
18 1071
18 497
18 1678
18 1166
18 456
18 548
18 5207
18 5208
18 5209
18 2442
18 3919
18 1347
18 5210
18 478
18 5211
18 357
18 1930
18 2638
18 2016
18 1713
18 2060
18 3365
18 5212
18 5213
18 1529
18 4854
18 1834
18 5214
18 1344
18 615
18 5215
18 2219
18 5216
18 5217
18 5218
18 5219
18 5220
18 5221
18 5222
18 5223
18 5224
18 5225
18 5226
18 5228
18 5229
18 5230
18 5231
18 5232
18 5233
18 5234
18 4348
18 5235
18 5236
18 5237
18 5238
18 5239
18 5240
18 5241
18 5242
18 5243
18 5245
18 5246
18 3730
18 5247
18 392
18 5248
18 5249
18 5250
18 5251
18 5244
18 5252
18 5253
18 5254
18 5255
18 5257
18 5268
18 5258
18 5259
18 5227
18 5260
18 5261
18 5262
18 5263
18 5264
18 5266
18 5267
18 5269
18 5270
18 5271
18 5272
18 5273
18 5274
18 5275
18 5276
18 5277
18 5278
18 5279
18 5280
18 5281
18 5282
18 5283
18 5284
18 5286
18 5287
18 5288
18 5289
18 5290
18 5292
18 5293
18 5294
18 366
18 1308
18 5295
18 5296
18 5297
18 5298
18 5299
18 5300
18 5291
18 5302
18 5303
18 5304
18 5305
18 5306
18 5307
18 5308
18 5301
18 5309
18 5310
18 5311
18 5312
18 5313
18 5314
18 5315
18 5316
18 2348
18 5317
18 5318
18 5319
18 5320
18 5322
18 5324
18 5325
18 5326
18 5327
18 5328
18 5285
18 5329
18 5330
18 5331
18 5333
18 1342
18 5336
18 5337
18 5338
18 5340
18 5341
18 5342
18 5343
18 5344
18 5345
18 5346
18 5347
18 5348
18 5349
18 5350
18 5351
18 5352
18 5353
18 1126
18 5354
18 5355
18 5356
18 5357
18 1753
18 5358
18 5359
18 5360
18 5361
18 5362
18 5363
18 3586
18 5364
18 5365
18 5366
18 5367
18 5368
18 5369
18 5370
18 5371
18 5372
18 5373
18 5374
18 5375
18 5376
18 5377
18 5378
18 5379
18 5380
18 5381
18 5382
18 5384
18 5385
18 5386
18 5387
18 5388
18 5389
18 5390
18 3698
18 2864
18 1449
18 442
18 5391
18 5392
18 5393
18 5394
18 5395
18 5396
18 5397
18 5398
18 5399
18 5400
18 5401
18 5402
18 5383
18 5403
18 5404
18 5405
18 5406
18 5407
18 439
18 5409
18 5410
18 5411
18 5412
18 5413
18 5414
18 5415
18 5416
18 5417
18 5418
18 5419
18 5420
18 5421
18 5422
18 5423
18 5424
18 5425
18 5426
18 5427
18 5428
18 5429
18 5430
18 5431
18 5432
18 5433
18 5434
18 5436
18 5437
18 5438
18 5591
18 5441
18 5443
18 5444
18 5445
18 5446
18 5447
18 5448
18 5449
18 5450
18 5451
18 5452
18 4347
18 5453
18 5454
18 5455
18 5456
18 5457
18 5458
18 5459
18 5460
18 5461
18 3251
18 5462
18 5463
18 5464
18 5465
18 5466
18 5467
18 5468
18 5469
18 5470
18 5471
18 5472
18 5473
18 4221
18 5474
18 4679
18 4378
18 5475
18 5476
18 912
18 1812
18 2000
18 5478
18 5479
18 1305
18 5480
18 5481
18 5482
18 5483
18 5485
18 2375
18 4483
18 5563
18 5564
18 5477
18 370
18 1124
18 5486
18 5487
18 5488
18 5489
18 5265
18 5490
18 5491
18 5493
18 5494
18 5495
18 5496
18 5497
18 5498
18 5499
18 5500
18 5501
18 5502
18 5503
18 5504
18 5505
18 5506
18 5507
18 5508
18 5509
18 5510
18 5511
18 5512
18 5513
18 3097
18 5514
18 5515
18 5516
18 5517
18 5518
18 5519
18 5520
18 5521
18 5522
18 5523
18 5524
18 5525
18 5526
18 5527
18 5528
18 5529
18 5530
18 5531
18 5532
18 5009
18 5533
18 5534
18 5535
18 5536
18 5537
18 5538
18 5539
18 5540
18 5541
18 5542
18 5543
18 5544
18 5545
18 5546
18 5547
18 883
18 5549
18 1138
18 5551
18 5552
18 5553
18 5554
18 5555
18 5556
18 5557
18 5558
18 5559
18 5560
18 5561
18 5562
18 5565
18 1816
18 6130
18 5632
18 6146
18 6194
18 2238
18 1471
18 2345
18 2376
18 2115
18 3010
18 2434
18 1477
18 3506
18 762
18 300
18 1161
18 436