SELECT 
  SQL_CALC_FOUND_ROWS products.product_id, 
  descr1.product as product, 
  companies.company as company_name, 
  products.product_type, 
  products.parent_product_id 
FROM 
  cscart_products as products 
  LEFT JOIN cscart_product_descriptions as descr1 ON descr1.product_id = products.product_id 
  AND descr1.lang_code = 'en' 
  LEFT JOIN cscart_product_prices as prices ON prices.product_id = products.product_id 
  AND prices.lower_limit = 1 
  LEFT JOIN cscart_companies AS companies ON companies.company_id = products.company_id 
  INNER JOIN cscart_products_categories as products_categories ON products_categories.product_id = products.product_id 
  INNER JOIN cscart_categories ON cscart_categories.category_id = products_categories.category_id 
  AND (
    cscart_categories.usergroup_ids = '' 
    OR FIND_IN_SET(
      0, cscart_categories.usergroup_ids
    ) 
    OR FIND_IN_SET(
      1, cscart_categories.usergroup_ids
    )
  ) 
  AND cscart_categories.status IN ('A', 'H') 
  AND cscart_categories.storefront_id IN (0, 1) 
  LEFT JOIN cscart_warehouses_sum_products_amount as war_sum_amount ON war_sum_amount.product_id = products.product_id 
  LEFT JOIN cscart_warehouses_destination_products_amount AS warehouses_destination_products_amount ON warehouses_destination_products_amount.product_id = products.product_id 
  AND warehouses_destination_products_amount.destination_id = 0 
  AND warehouses_destination_products_amount.storefront_id = 0 
WHERE 
  1 
  AND cscart_categories.category_id IN (
    22491, 
    22492, 
    22493, 
    22494, 
    22495, 
    22496, 
    22497, 
    22498, 
    22499, 
    22500, 
    22501, 
    22502, 
    22503, 
    22504, 
    22505, 
    22506, 
    22507, 
    22508, 
    22509, 
    22510, 
    22511, 
    22512, 
    22513, 
    22514, 
    22515, 
    22516, 
    22517, 
    22518, 
    22519, 
    22520, 
    22521, 
    22522, 
    22523, 
    22524, 
    22525, 
    22526, 
    22527, 
    22528, 
    22529, 
    22530, 
    22531, 
    22532, 
    22533, 
    22534, 
    22535, 
    22536, 
    22537, 
    22538, 
    22539, 
    22540, 
    22541, 
    22542, 
    22543, 
    22544, 
    22545, 
    22546, 
    22547, 
    22548, 
    22549, 
    22550, 
    22551, 
    22552, 
    22553, 
    22554, 
    22555, 
    22556, 
    22557, 
    22558, 
    22559, 
    22560, 
    22561, 
    22563, 
    22564, 
    22565, 
    22566, 
    22567, 
    22568, 
    22569, 
    22570, 
    22571, 
    22572, 
    22573, 
    22574, 
    22575, 
    22576, 
    22577, 
    22578, 
    22579, 
    22580, 
    22581, 
    22582, 
    22583, 
    22584, 
    22585, 
    22586, 
    22587, 
    22588, 
    22589, 
    22590, 
    22591, 
    22592, 
    22593, 
    22594, 
    22595, 
    22596, 
    22597, 
    22598, 
    22599, 
    22600, 
    22601, 
    22602, 
    22603, 
    22604, 
    22605, 
    22606, 
    22607, 
    22608, 
    22609, 
    22610, 
    22611, 
    22612, 
    22613, 
    22614, 
    22615, 
    22616, 
    22617, 
    22618, 
    22619, 
    22620, 
    22621, 
    22622, 
    22623, 
    22624, 
    22625, 
    22626, 
    22627, 
    22628, 
    22629, 
    22630, 
    22631, 
    22632, 
    22633, 
    22634, 
    22635, 
    22636, 
    22637, 
    22638, 
    22639, 
    22640, 
    22641, 
    22642, 
    22643, 
    22644, 
    22645, 
    22646, 
    22647, 
    22648, 
    22649, 
    22650, 
    22651, 
    22652, 
    22653, 
    22654, 
    22655, 
    22656, 
    22657, 
    22658, 
    22659, 
    22660, 
    22661, 
    22662, 
    22663, 
    22664, 
    22665, 
    22666, 
    22667, 
    22668, 
    22669, 
    22670, 
    22671, 
    22672, 
    22673, 
    22674, 
    22675, 
    22676, 
    22677, 
    22678, 
    22679, 
    22680, 
    22681, 
    22682, 
    22683, 
    22684, 
    22685, 
    22686, 
    22687, 
    22688, 
    22689, 
    22690, 
    22691, 
    22692, 
    22693, 
    22694, 
    22695, 
    22696, 
    22697, 
    22698, 
    22699, 
    22700, 
    22701, 
    22702, 
    22703, 
    22704, 
    22705, 
    22706, 
    22707, 
    22708, 
    22709, 
    22710, 
    22711, 
    22712, 
    22713, 
    22714, 
    22715, 
    22716, 
    22717, 
    22718, 
    22719, 
    22720, 
    22721, 
    22722, 
    22723, 
    22724, 
    22725, 
    22726, 
    22727, 
    22728, 
    22729, 
    22730, 
    22731, 
    22732, 
    22733, 
    22734, 
    22735, 
    22736, 
    22737, 
    22738, 
    22739, 
    22740, 
    22741, 
    22742, 
    22743, 
    22744, 
    22745, 
    22746, 
    22747, 
    22748, 
    22749, 
    22750, 
    22751, 
    22752, 
    22753, 
    22754, 
    22755, 
    22756, 
    22757, 
    22758, 
    22759, 
    22760, 
    22761, 
    22762, 
    22763, 
    22764, 
    22765, 
    22766, 
    22767, 
    22768, 
    22769, 
    22770, 
    22771, 
    22772, 
    22773, 
    22774, 
    22775, 
    22776, 
    22777, 
    22778, 
    22779, 
    22780, 
    22781, 
    22782, 
    22783, 
    22784, 
    22785, 
    22786, 
    22787, 
    22788, 
    22789, 
    22790, 
    22791, 
    22792, 
    22793, 
    22794, 
    22795, 
    22796, 
    22797, 
    22798, 
    22799, 
    22800, 
    22801, 
    22802, 
    22803, 
    22804, 
    22805, 
    22806, 
    22807, 
    22808, 
    22809, 
    22810, 
    22811, 
    22812, 
    22813, 
    22814, 
    22815, 
    22816, 
    22817, 
    22818, 
    22819, 
    22820, 
    22821, 
    22822, 
    22823, 
    22824, 
    22825, 
    22826, 
    22827, 
    22828, 
    22829, 
    22830, 
    22831, 
    22832, 
    22833, 
    22834, 
    22835, 
    22836, 
    22837, 
    22839, 
    22840, 
    22841, 
    22842, 
    22843, 
    22844, 
    22845, 
    22846, 
    22847, 
    22848, 
    22849, 
    22850, 
    22851, 
    22852, 
    22853, 
    22854, 
    22855, 
    22856, 
    22857, 
    22858, 
    22859, 
    22860, 
    22861, 
    22862, 
    22863, 
    22864, 
    22865, 
    22866, 
    22867, 
    22868, 
    22869, 
    22870, 
    22871, 
    22872, 
    22873, 
    22874, 
    22875, 
    22876, 
    22877, 
    22878, 
    22879, 
    22880, 
    22881, 
    22882, 
    22883, 
    22884, 
    22885, 
    22886, 
    22887, 
    22888, 
    22889, 
    22890, 
    22891, 
    22892, 
    22893, 
    22894, 
    22895, 
    22896, 
    22897, 
    22898, 
    22899, 
    22900, 
    22901, 
    22902, 
    22903, 
    22904, 
    22905, 
    22906, 
    22907, 
    22908, 
    22909, 
    22910, 
    22911, 
    22912, 
    22913, 
    22914, 
    22915, 
    22916, 
    22917, 
    22918, 
    22919, 
    22920, 
    22921, 
    22922, 
    22923, 
    22924, 
    22925, 
    22926, 
    22927, 
    22928, 
    22929, 
    22930, 
    22931, 
    22932, 
    22933, 
    22934, 
    22935, 
    22936, 
    22937, 
    22938, 
    22939, 
    22940, 
    22941, 
    22942, 
    22943, 
    22944, 
    22945, 
    22946, 
    22947, 
    22948, 
    22949, 
    22950, 
    22951, 
    22952, 
    22953, 
    22954, 
    22955, 
    22956, 
    22957, 
    22958, 
    22959, 
    22960, 
    22961, 
    22962, 
    22963, 
    22964, 
    22965, 
    22966, 
    22967, 
    22968, 
    22969, 
    22970, 
    22971, 
    22972, 
    22973, 
    22974, 
    22975, 
    22976, 
    22977, 
    22978, 
    22979, 
    22980, 
    22981, 
    22982, 
    22983, 
    22984, 
    22985, 
    22986, 
    22987, 
    22988, 
    22989, 
    22990, 
    22991, 
    22992, 
    22993, 
    22994, 
    22995, 
    22996, 
    22997, 
    22998, 
    22999, 
    23000, 
    23001, 
    23002, 
    23003, 
    23004, 
    23005, 
    23006, 
    23007, 
    23008, 
    23009, 
    23010, 
    23011, 
    23012, 
    23013, 
    23014, 
    23015, 
    23016, 
    23017, 
    23018, 
    23019, 
    23020, 
    23021, 
    23022, 
    23023, 
    23024, 
    23025, 
    23026, 
    23027, 
    23028, 
    23029, 
    23030, 
    23031, 
    23032, 
    23033, 
    23034, 
    23035, 
    23036, 
    23037, 
    23038, 
    23039, 
    23040, 
    23041, 
    23042, 
    23043, 
    23044, 
    23045, 
    23046, 
    23047, 
    23048, 
    23049, 
    23050, 
    23051, 
    23052, 
    23053, 
    23054, 
    23055, 
    23056, 
    23057, 
    23058, 
    23059, 
    23060, 
    23061, 
    23062, 
    23063, 
    23064, 
    23065, 
    23066, 
    23067, 
    23068, 
    23069, 
    23070, 
    23071, 
    23072, 
    23073, 
    23074, 
    23075, 
    23076, 
    23077, 
    23078, 
    23079, 
    23080, 
    23081, 
    23082, 
    23083, 
    23084, 
    23085, 
    23086, 
    23087, 
    23088, 
    23089, 
    23090, 
    23091, 
    23092, 
    23093, 
    23094, 
    23095, 
    23096, 
    23097, 
    23098, 
    23099, 
    23100, 
    23101, 
    23102, 
    23103, 
    23104, 
    23105, 
    23106, 
    23107, 
    23108, 
    23109, 
    23110, 
    23111, 
    23112, 
    23113, 
    23114, 
    23115, 
    23116, 
    23117, 
    23118, 
    23119, 
    23120, 
    23121, 
    23122, 
    23123, 
    23124, 
    23125, 
    23126, 
    23127, 
    23128, 
    23129, 
    23130, 
    23131, 
    23132, 
    23133, 
    23134, 
    23135, 
    23136, 
    23137, 
    23138, 
    23139, 
    23140, 
    23141, 
    23142, 
    23143, 
    23144, 
    23145, 
    23146, 
    23147, 
    23148, 
    23149, 
    23150, 
    23151, 
    23152, 
    23153, 
    23154, 
    23155, 
    23156, 
    23157, 
    23158, 
    23159, 
    23160, 
    23161, 
    23162, 
    23210
  ) 
  AND products.product_id NOT IN (227223) 
  AND companies.status IN ('A') 
  AND products.company_id IN (2, 64, 92, 103, 104, 121, 127, 0) 
  AND (
    CASE products.is_stock_split_by_warehouses WHEN 'Y' THEN warehouses_destination_products_amount.amount ELSE products.amount END
  ) > 0 
  AND (
    products.usergroup_ids = '' 
    OR FIND_IN_SET(0, products.usergroup_ids) 
    OR FIND_IN_SET(1, products.usergroup_ids)
  ) 
  AND products.status IN ('A') 
  AND prices.usergroup_id IN (0, 0, 1) 
  AND products.parent_product_id = 0 
  AND products.product_type != 'D' 
GROUP BY 
  products.product_id 
ORDER BY 
  products.timestamp desc, 
  products.product_id ASC 
LIMIT 
  0, 4

Query time 0.00008

JSON explain

{
  "query_block": {
    "select_id": 1,
    "filesort": {
      "sort_key": "products.`timestamp` desc, products.product_id",
      "temporary_table": {
        "nested_loop": [
          {
            "table": {
              "table_name": "war_sum_amount",
              "access_type": "system",
              "possible_keys": ["PRIMARY"],
              "rows": 0,
              "filtered": 0,
              "const_row_not_found": true
            }
          },
          {
            "table": {
              "table_name": "warehouses_destination_products_amount",
              "access_type": "system",
              "possible_keys": ["PRIMARY", "idx_storefront_id"],
              "rows": 0,
              "filtered": 0,
              "const_row_not_found": true
            }
          },
          {
            "table": {
              "table_name": "products",
              "access_type": "ALL",
              "possible_keys": ["PRIMARY", "status", "idx_parent_product_id"],
              "rows": 67,
              "filtered": 79.83960724,
              "attached_condition": "products.parent_product_id = 0 and products.product_id <> 227223 and products.company_id in (2,64,92,103,104,121,127,0) and case products.is_stock_split_by_warehouses when 'Y' then NULL else products.amount end > 0 and (products.usergroup_ids = '' or find_in_set(0,products.usergroup_ids) or find_in_set(1,products.usergroup_ids)) and products.`status` = 'A' and products.product_type <> 'D'"
            }
          },
          {
            "table": {
              "table_name": "descr1",
              "access_type": "eq_ref",
              "possible_keys": ["PRIMARY", "product_id"],
              "key": "PRIMARY",
              "key_length": "9",
              "used_key_parts": ["product_id", "lang_code"],
              "ref": ["ebonza_cscart_test.products.product_id", "const"],
              "rows": 1,
              "filtered": 100,
              "attached_condition": "trigcond(descr1.lang_code = 'en')"
            }
          },
          {
            "table": {
              "table_name": "companies",
              "access_type": "eq_ref",
              "possible_keys": ["PRIMARY"],
              "key": "PRIMARY",
              "key_length": "4",
              "used_key_parts": ["company_id"],
              "ref": ["ebonza_cscart_test.products.company_id"],
              "rows": 1,
              "filtered": 100,
              "attached_condition": "companies.`status` = 'A'"
            }
          },
          {
            "table": {
              "table_name": "prices",
              "access_type": "ref",
              "possible_keys": [
                "usergroup",
                "product_id",
                "lower_limit",
                "usergroup_id"
              ],
              "key": "usergroup",
              "key_length": "3",
              "used_key_parts": ["product_id"],
              "ref": ["ebonza_cscart_test.products.product_id"],
              "rows": 1,
              "filtered": 90.5405426,
              "attached_condition": "prices.lower_limit = 1 and prices.usergroup_id in (0,0,1)",
              "using_index": true
            }
          },
          {
            "table": {
              "table_name": "products_categories",
              "access_type": "ref",
              "possible_keys": ["PRIMARY", "pt"],
              "key": "pt",
              "key_length": "3",
              "used_key_parts": ["product_id"],
              "ref": ["ebonza_cscart_test.products.product_id"],
              "rows": 1,
              "filtered": 100
            }
          },
          {
            "table": {
              "table_name": "cscart_categories",
              "access_type": "eq_ref",
              "possible_keys": ["PRIMARY", "c_status", "p_category_id"],
              "key": "PRIMARY",
              "key_length": "3",
              "used_key_parts": ["category_id"],
              "ref": ["ebonza_cscart_test.products_categories.category_id"],
              "rows": 1,
              "filtered": 100,
              "index_condition": "cscart_categories.category_id in (22491,22492,22493,22494,22495,22496,22497,22498,22499,22500,22501,22502,22503,22504,22505,22506,22507,22508,22509,22510,22511,22512,22513,22514,22515,22516,22517,22518,22519,22520,22521,22522,22523,22524,22525,22526,22527,22528,22529,22530,22531,22532,22533,22534,22535,22536,22537,22538,22539,22540,22541,22542,22543,22544,22545,22546,22547,22548,22549,22550,22551,22552,22553,22554,22555,22556,22557,22558,22559,22560,22561,22563,22564,22565,22566,22567,22568,22569,22570,22571,22572,22573,22574,22575,22576,22577,22578,22579,22580,22581,22582,22583,22584,22585,22586,22587,22588,22589,22590,22591,22592,22593,22594,22595,22596,22597,22598,22599,22600,22601,22602,22603,22604,22605,22606,22607,22608,22609,22610,22611,22612,22613,22614,22615,22616,22617,22618,22619,22620,22621,22622,22623,22624,22625,22626,22627,22628,22629,22630,22631,22632,22633,22634,22635,22636,22637,22638,22639,22640,22641,22642,22643,22644,22645,22646,22647,22648,22649,22650,22651,22652,22653,22654,22655,22656,22657,22658,22659,22660,22661,22662,22663,22664,22665,22666,22667,22668,22669,22670,22671,22672,22673,22674,22675,22676,22677,22678,22679,22680,22681,22682,22683,22684,22685,22686,22687,22688,22689,22690,22691,22692,22693,22694,22695,22696,22697,22698,22699,22700,22701,22702,22703,22704,22705,22706,22707,22708,22709,22710,22711,22712,22713,22714,22715,22716,22717,22718,22719,22720,22721,22722,22723,22724,22725,22726,22727,22728,22729,22730,22731,22732,22733,22734,22735,22736,22737,22738,22739,22740,22741,22742,22743,22744,22745,22746,22747,22748,22749,22750,22751,22752,22753,22754,22755,22756,22757,22758,22759,22760,22761,22762,22763,22764,22765,22766,22767,22768,22769,22770,22771,22772,22773,22774,22775,22776,22777,22778,22779,22780,22781,22782,22783,22784,22785,22786,22787,22788,22789,22790,22791,22792,22793,22794,22795,22796,22797,22798,22799,22800,22801,22802,22803,22804,22805,22806,22807,22808,22809,22810,22811,22812,22813,22814,22815,22816,22817,22818,22819,22820,22821,22822,22823,22824,22825,22826,22827,22828,22829,22830,22831,22832,22833,22834,22835,22836,22837,22839,22840,22841,22842,22843,22844,22845,22846,22847,22848,22849,22850,22851,22852,22853,22854,22855,22856,22857,22858,22859,22860,22861,22862,22863,22864,22865,22866,22867,22868,22869,22870,22871,22872,22873,22874,22875,22876,22877,22878,22879,22880,22881,22882,22883,22884,22885,22886,22887,22888,22889,22890,22891,22892,22893,22894,22895,22896,22897,22898,22899,22900,22901,22902,22903,22904,22905,22906,22907,22908,22909,22910,22911,22912,22913,22914,22915,22916,22917,22918,22919,22920,22921,22922,22923,22924,22925,22926,22927,22928,22929,22930,22931,22932,22933,22934,22935,22936,22937,22938,22939,22940,22941,22942,22943,22944,22945,22946,22947,22948,22949,22950,22951,22952,22953,22954,22955,22956,22957,22958,22959,22960,22961,22962,22963,22964,22965,22966,22967,22968,22969,22970,22971,22972,22973,22974,22975,22976,22977,22978,22979,22980,22981,22982,22983,22984,22985,22986,22987,22988,22989,22990,22991,22992,22993,22994,22995,22996,22997,22998,22999,23000,23001,23002,23003,23004,23005,23006,23007,23008,23009,23010,23011,23012,23013,23014,23015,23016,23017,23018,23019,23020,23021,23022,23023,23024,23025,23026,23027,23028,23029,23030,23031,23032,23033,23034,23035,23036,23037,23038,23039,23040,23041,23042,23043,23044,23045,23046,23047,23048,23049,23050,23051,23052,23053,23054,23055,23056,23057,23058,23059,23060,23061,23062,23063,23064,23065,23066,23067,23068,23069,23070,23071,23072,23073,23074,23075,23076,23077,23078,23079,23080,23081,23082,23083,23084,23085,23086,23087,23088,23089,23090,23091,23092,23093,23094,23095,23096,23097,23098,23099,23100,23101,23102,23103,23104,23105,23106,23107,23108,23109,23110,23111,23112,23113,23114,23115,23116,23117,23118,23119,23120,23121,23122,23123,23124,23125,23126,23127,23128,23129,23130,23131,23132,23133,23134,23135,23136,23137,23138,23139,23140,23141,23142,23143,23144,23145,23146,23147,23148,23149,23150,23151,23152,23153,23154,23155,23156,23157,23158,23159,23160,23161,23162,23210)",
              "attached_condition": "(cscart_categories.usergroup_ids = '' or find_in_set(0,cscart_categories.usergroup_ids) or find_in_set(1,cscart_categories.usergroup_ids)) and cscart_categories.`status` in ('A','H') and cscart_categories.storefront_id in (0,1)"
            }
          }
        ]
      }
    }
  }
}

Result

product_id product company_name product_type parent_product_id
227236 Elegant girls shirt B2Bonza Test Vendor P 0