SELECT 
  SQL_CALC_FOUND_ROWS products.product_id, 
  descr1.product as product, 
  companies.company as company_name, 
  popularity.total as popularity, 
  MIN(
    IF(
      prices.percentage_discount = 0, 
      prices.price, 
      prices.price - (
        prices.price * prices.percentage_discount
      )/ 100
    )
  ) as price, 
  products.product_type, 
  products.parent_product_id, 
  products.list_price as list_price, 
  MAX(
    100 - (
      (prices.price * 100) / products.list_price
    )
  ) AS sales_discount 
FROM 
  cscart_products as products 
  LEFT JOIN cscart_product_features_values ON cscart_product_features_values.product_id = products.product_id 
  AND cscart_product_features_values.lang_code = 'en' 
  LEFT JOIN cscart_product_features ON cscart_product_features_values.feature_id = cscart_product_features.feature_id 
  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_product_prices as prices_2 ON prices.product_id = prices_2.product_id 
  AND prices_2.lower_limit = 1 
  AND prices_2.price < prices.price 
  AND prices_2.usergroup_id IN (0, 0, 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_product_popularity as popularity ON popularity.product_id = products.product_id 
  LEFT JOIN cscart_product_sales ON cscart_product_sales.product_id = products.product_id 
  AND cscart_product_sales.category_id = products_categories.category_id 
WHERE 
  1 
  AND companies.status IN ('A') 
  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 prices_2.price IS NULL 
  AND products.parent_product_id = 0 
  AND products.product_type != 'D' 
GROUP BY 
  products.product_id 
HAVING 
  sales_discount > 0 
  AND price < list_price 
ORDER BY 
  product asc, 
  products.product_id ASC 
LIMIT 
  120, 24

Query time 0.00665

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost": 5.01502926,
    "having_condition": "sales_discount > 0 and price < products.list_price",
    "filesort": {
      "sort_key": "descr1.product, products.product_id",
      "temporary_table": {
        "nested_loop": [
          {
            "table": {
              "table_name": "products",
              "access_type": "index",
              "possible_keys": ["PRIMARY", "status", "idx_parent_product_id"],
              "key": "PRIMARY",
              "key_length": "3",
              "used_key_parts": ["product_id"],
              "loops": 1,
              "rows": 1156,
              "cost": 0.2215076,
              "filtered": 54.51009369,
              "attached_condition": "products.parent_product_id = 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": "cscart_product_features_values",
              "access_type": "ref",
              "possible_keys": [
                "lang_code",
                "product_id",
                "idx_product_feature_variant_id"
              ],
              "key": "product_id",
              "key_length": "3",
              "used_key_parts": ["product_id"],
              "ref": ["u508912950_dev_2025.products.product_id"],
              "loops": 630.1366782,
              "rows": 1,
              "cost": 0.614197393,
              "filtered": 100,
              "attached_condition": "trigcond(cscart_product_features_values.lang_code = 'en')",
              "using_index": true
            }
          },
          {
            "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": ["u508912950_dev_2025.products.product_id", "const"],
              "loops": 630.1366782,
              "rows": 1,
              "cost": 0.64308185,
              "filtered": 100,
              "attached_condition": "trigcond(descr1.lang_code = 'en')"
            }
          },
          {
            "table": {
              "table_name": "popularity",
              "access_type": "eq_ref",
              "possible_keys": ["PRIMARY", "total"],
              "key": "PRIMARY",
              "key_length": "3",
              "used_key_parts": ["product_id"],
              "ref": ["u508912950_dev_2025.products.product_id"],
              "loops": 630.1366782,
              "rows": 1,
              "cost": 0.56607705,
              "filtered": 100
            }
          },
          {
            "table": {
              "table_name": "companies",
              "access_type": "eq_ref",
              "possible_keys": ["PRIMARY"],
              "key": "PRIMARY",
              "key_length": "4",
              "used_key_parts": ["company_id"],
              "ref": ["u508912950_dev_2025.products.company_id"],
              "loops": 630.1366782,
              "rows": 1,
              "cost": 0.56443865,
              "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": ["u508912950_dev_2025.products.product_id"],
              "loops": 630.1366782,
              "rows": 1,
              "cost": 0.611906936,
              "filtered": 100,
              "attached_condition": "prices.lower_limit = 1 and prices.usergroup_id in (0,0,1)"
            }
          },
          {
            "table": {
              "table_name": "prices_2",
              "access_type": "ref",
              "possible_keys": [
                "usergroup",
                "product_id",
                "lower_limit",
                "usergroup_id"
              ],
              "key": "usergroup",
              "key_length": "3",
              "used_key_parts": ["product_id"],
              "ref": ["u508912950_dev_2025.products.product_id"],
              "loops": 630.1366782,
              "rows": 1,
              "cost": 0.611906936,
              "filtered": 100,
              "attached_condition": "trigcond(prices_2.price is null) and trigcond(prices_2.lower_limit = 1 and prices_2.price < prices.price and prices_2.usergroup_id in (0,0,1))",
              "not_exists": true
            }
          },
          {
            "table": {
              "table_name": "products_categories",
              "access_type": "ref",
              "possible_keys": ["PRIMARY", "pt"],
              "key": "pt",
              "key_length": "3",
              "used_key_parts": ["product_id"],
              "ref": ["u508912950_dev_2025.products.product_id"],
              "loops": 630.1366782,
              "rows": 1,
              "cost": 0.615016593,
              "filtered": 100,
              "using_index": true
            }
          },
          {
            "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": ["u508912950_dev_2025.products_categories.category_id"],
              "loops": 630.1366782,
              "rows": 1,
              "cost": 0.56689625,
              "filtered": 100,
              "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 popularity price product_type parent_product_id list_price sales_discount
14005 Professional Liquid Lipstick Aden Cosmetics Malta 60 11.89000000 P 0 22.00 45.954545
15746 Quilted Black Flap Wallet BP Beauty 27 5.50000000 P 0 12.49 55.964772
16337 Quilted Crossbody Phone Bag with Patterned Strap BP Beauty 12 8.00000000 P 0 20.99 61.886613
16336 Quilted Crossbody Phone Wallet BP Beauty 6 6.50000000 P 0 18.49 64.845863
15745 Red Textured Flap Wallet BP Beauty 30 4.80000000 P 0 15.99 69.981238
14662 Rose Pink Structured Handbag BP Beauty 27 14.80000000 P 0 25.99 43.055021
13464 Rosemary 36Oils 87 3.70000000 P 0 6.00 38.333333
13998 Satin Effect Lipstick Aden Cosmetics Malta 60 11.79000000 P 0 21.99 46.384720
13933 Shine Eyeshadow Powder Duo Aden Cosmetics Malta 69 7.79000000 P 0 21.99 64.574807
14148 SkyBlue Shine Duffel Bag BP Beauty 21 16.00000000 P 0 25.49 37.230286
14678 Straw Cloche Hat BP Beauty 36 4.50000000 P 0 15.99 71.857411
14131 Sunny Zest Tote Bag BP Beauty 138 15.00000000 P 0 25.00 40.000000
13465 Tea Tree 36Oils 105 4.10000000 P 0 7.50 45.333333
18481 test Surf Shop 21 8.00000000 P 0 10.00 20.000000
19930 test 1 Surf Shop 12 1.00000000 P 0 2.00 50.000000
19598 test1 Test Fahad 1477 100.00000000 P 0 110.00 9.090909
19599 test1 [CLONE] Test Fahad 626 100.00000000 P 0 110.00 9.090909
19602 test1 [CLONE] Test Fahad 1231 100.00000000 P 0 110.00 9.090909
14142 The Denim Drift Tote BP Beauty 18 16.00000000 P 0 27.49 41.797017
14138 The Lined Tote Bag BP Beauty 126 16.00000000 P 0 27.49 41.797017
14133 The Stripe Edit Tote Bag BP Beauty 39 15.00000000 P 0 25.00 40.000000
14137 Thread & Straw Bag BP Beauty 9 17.00000000 P 0 29.99 43.314438
13497 Tinted Lip Balm - 5ML 36Oils 45 4.00000000 P 0 10.00 60.000000
15734 Two-Compartment Wallet BP Beauty 123 5.80000000 P 0 15.49 62.556488