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 (
    18318, 
    18319, 
    18334, 
    18348, 
    18351, 
    18361, 
    18381, 
    18410, 
    18416, 
    18534, 
    18537, 
    18547, 
    18553, 
    18559, 
    18570, 
    18574, 
    18581, 
    18585, 
    18593, 
    18597, 
    18613, 
    18622, 
    18629, 
    18642, 
    18650, 
    18651, 
    18659, 
    18320, 
    18335, 
    18349, 
    18352, 
    18362, 
    18382, 
    18409, 
    18411, 
    18535, 
    18538, 
    18548, 
    18554, 
    18560, 
    18571, 
    18575, 
    18582, 
    18586, 
    18594, 
    18598, 
    18614, 
    18623, 
    18630, 
    18643, 
    18652, 
    18654, 
    18660, 
    18323, 
    18336, 
    18353, 
    18363, 
    18383, 
    18412, 
    18415, 
    18531, 
    18539, 
    18549, 
    18555, 
    18561, 
    18572, 
    18576, 
    18583, 
    18587, 
    18595, 
    18599, 
    18615, 
    18624, 
    18631, 
    18644, 
    18653, 
    18655, 
    18661, 
    18333, 
    18337, 
    18354, 
    18364, 
    18384, 
    18413, 
    18532, 
    18540, 
    18550, 
    18556, 
    18562, 
    18577, 
    18588, 
    18600, 
    18625, 
    18632, 
    18645, 
    18656, 
    18662, 
    18338, 
    18347, 
    18355, 
    18365, 
    18385, 
    18414, 
    18533, 
    18541, 
    18551, 
    18557, 
    18563, 
    18578, 
    18589, 
    18601, 
    18626, 
    18633, 
    18657, 
    18339, 
    18350, 
    18359, 
    18366, 
    18386, 
    18536, 
    18542, 
    18564, 
    18579, 
    18590, 
    18602, 
    18627, 
    18634, 
    18658, 
    18340, 
    18360, 
    18387, 
    18543, 
    18545, 
    18565, 
    18591, 
    18603, 
    18628, 
    18663, 
    18341, 
    18367, 
    18544, 
    18546, 
    18566, 
    18592, 
    18604, 
    18635, 
    18342, 
    18368, 
    18389, 
    18552, 
    18567, 
    18605, 
    18636, 
    18343, 
    18369, 
    18390, 
    18558, 
    18568, 
    18606, 
    18637, 
    18344, 
    18370, 
    18569, 
    18584, 
    18607, 
    18638, 
    18345, 
    18371, 
    18573, 
    18596, 
    18608, 
    18639, 
    18346, 
    18372, 
    18580, 
    18609, 
    18620, 
    18640, 
    18610, 
    18621, 
    18611, 
    18641, 
    18612, 
    18646, 
    18379, 
    18616, 
    18647, 
    18380, 
    18617, 
    18648, 
    18394, 
    18618, 
    18649, 
    18397, 
    18619, 
    18398, 
    18404, 
    18405, 
    18406, 
    18407, 
    18408
  ) 
  AND companies.status IN ('A') 
  AND products.company_id IN (2, 64, 92, 103, 104, 121, 127, 0) 
  AND products.company_id = 2 
  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.company_id = 2 
  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, 16

Query time 0.00103

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": "companies",
              "access_type": "const",
              "possible_keys": ["PRIMARY"],
              "key": "PRIMARY",
              "key_length": "4",
              "used_key_parts": ["company_id"],
              "ref": ["const"],
              "rows": 1,
              "filtered": 100
            }
          },
          {
            "table": {
              "table_name": "products",
              "access_type": "ALL",
              "possible_keys": ["PRIMARY", "status", "idx_parent_product_id"],
              "rows": 67,
              "filtered": 79.83960724,
              "attached_condition": "products.company_id = 2 and products.parent_product_id = 0 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": "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 (18318,18319,18334,18348,18351,18361,18381,18410,18416,18534,18537,18547,18553,18559,18570,18574,18581,18585,18593,18597,18613,18622,18629,18642,18650,18651,18659,18320,18335,18349,18352,18362,18382,18409,18411,18535,18538,18548,18554,18560,18571,18575,18582,18586,18594,18598,18614,18623,18630,18643,18652,18654,18660,18323,18336,18353,18363,18383,18412,18415,18531,18539,18549,18555,18561,18572,18576,18583,18587,18595,18599,18615,18624,18631,18644,18653,18655,18661,18333,18337,18354,18364,18384,18413,18532,18540,18550,18556,18562,18577,18588,18600,18625,18632,18645,18656,18662,18338,18347,18355,18365,18385,18414,18533,18541,18551,18557,18563,18578,18589,18601,18626,18633,18657,18339,18350,18359,18366,18386,18536,18542,18564,18579,18590,18602,18627,18634,18658,18340,18360,18387,18543,18545,18565,18591,18603,18628,18663,18341,18367,18544,18546,18566,18592,18604,18635,18342,18368,18389,18552,18567,18605,18636,18343,18369,18390,18558,18568,18606,18637,18344,18370,18569,18584,18607,18638,18345,18371,18573,18596,18608,18639,18346,18372,18580,18609,18620,18640,18610,18621,18611,18641,18612,18646,18379,18616,18647,18380,18617,18648,18394,18618,18649,18397,18619,18398,18404,18405,18406,18407,18408)",
              "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
227223 Soap RENMAR P 0