SELECT 
  products.product_id, 
  descr1.product as product, 
  companies.company as company_name, 
  products.kl_erp_inventory_id, 
  products.product_type, 
  products.parent_product_id, 
  products.master_product_offers_count, 
  products.master_product_id, 
  products.company_id, 
  products.kl_enable_qc, 
  products.kl_qc_amount 
FROM 
  cscart_products as products 
  INNER JOIN cscart_product_features_values as c_var ON c_var.product_id = products.product_id 
  AND c_var.lang_code = 'en' 
  AND c_var.variant_id = 52820 
  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 
  AND prices.usergroup_id IN (0, 1) 
  LEFT JOIN cscart_companies AS companies ON companies.company_id = products.company_id 
  INNER JOIN cscart_products_categories as products_categories USE INDEX (
    idx_products_categories_composite
  ) ON products_categories.product_id = products.product_id 
  INNER JOIN cscart_categories ON cscart_categories.category_id = products_categories.category_id 
  AND cscart_categories.status IN ('A', 'H') 
  AND cscart_categories.storefront_id IN (0, 1) 
  LEFT JOIN cscart_product_sales USE INDEX (
    idx_product_sales_category_amount
  ) 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') 
    OR products.company_id = 0
  ) 
  AND products.company_id IN (13, 0) 
  AND (
    products.amount > 0 
    OR products.tracking = 'D'
  ) 
  AND products.status IN ('A') 
  AND products.parent_product_id = 0 
  AND products.master_product_status IN ('A') 
  AND products.master_product_id = 0 
  AND products.company_id > 0 
GROUP BY 
  products.product_id 
ORDER BY 
  cscart_product_sales.amount desc, 
  products.product_id ASC 
LIMIT 
  0, 24

Query time 0.00276

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "30.83"
    },
    "ordering_operation": {
      "using_filesort": true,
      "grouping_operation": {
        "using_temporary_table": true,
        "using_filesort": false,
        "nested_loop": [
          {
            "table": {
              "table_name": "c_var",
              "access_type": "ref",
              "possible_keys": [
                "variant_id",
                "lang_code",
                "product_id",
                "idx_product_feature_variant_id"
              ],
              "key": "variant_id",
              "used_key_parts": [
                "variant_id"
              ],
              "key_length": "3",
              "ref": [
                "const"
              ],
              "rows_examined_per_scan": 75,
              "rows_produced_per_join": 37,
              "filtered": "50.00",
              "using_index": true,
              "cost_info": {
                "read_cost": "1.14",
                "eval_cost": "3.75",
                "prefix_cost": "8.64",
                "data_read_per_join": "1K"
              },
              "used_columns": [
                "feature_id",
                "product_id",
                "variant_id",
                "lang_code"
              ],
              "attached_condition": "(`cscart_db`.`c_var`.`lang_code` = 'en')"
            }
          },
          {
            "table": {
              "table_name": "products",
              "access_type": "eq_ref",
              "possible_keys": [
                "PRIMARY",
                "age_verification",
                "status",
                "idx_parent_product_id",
                "idx_master_product_id",
                "youtube_link",
                "idx_products_parent_lookup",
                "idx_products_status_company",
                "idx_products_master_status",
                "idx_products_inventory",
                "idx_products_status_company_master",
                "idx_products_main_query",
                "idx_products_query_opt",
                "idx_products_composite_query",
                "idx_kl_qc_enabled"
              ],
              "key": "PRIMARY",
              "used_key_parts": [
                "product_id"
              ],
              "key_length": "3",
              "ref": [
                "cscart_db.c_var.product_id"
              ],
              "rows_examined_per_scan": 1,
              "rows_produced_per_join": 1,
              "filtered": "5.00",
              "cost_info": {
                "read_cost": "13.98",
                "eval_cost": "0.19",
                "prefix_cost": "26.36",
                "data_read_per_join": "9K"
              },
              "used_columns": [
                "product_id",
                "kl_erp_inventory_id",
                "product_type",
                "status",
                "company_id",
                "amount",
                "kl_enable_qc",
                "kl_qc_amount",
                "tracking",
                "parent_product_id",
                "master_product_id",
                "master_product_status",
                "master_product_offers_count"
              ],
              "attached_condition": "((`cscart_db`.`products`.`master_product_id` = 0) and (`cscart_db`.`products`.`parent_product_id` = 0) and (`cscart_db`.`products`.`company_id` in (13,0)) and ((`cscart_db`.`products`.`amount` > 0) or (`cscart_db`.`products`.`tracking` = 'D')) and (`cscart_db`.`products`.`status` = 'A') and (`cscart_db`.`products`.`master_product_status` = 'A') and (`cscart_db`.`products`.`company_id` > 0))"
            }
          },
          {
            "table": {
              "table_name": "products_categories",
              "access_type": "ref",
              "possible_keys": [
                "idx_products_categories_composite"
              ],
              "key": "idx_products_categories_composite",
              "used_key_parts": [
                "product_id"
              ],
              "key_length": "3",
              "ref": [
                "cscart_db.c_var.product_id"
              ],
              "rows_examined_per_scan": 1,
              "rows_produced_per_join": 2,
              "filtered": "100.00",
              "using_index": true,
              "cost_info": {
                "read_cost": "0.47",
                "eval_cost": "0.22",
                "prefix_cost": "27.05",
                "data_read_per_join": "34"
              },
              "used_columns": [
                "product_id",
                "category_id"
              ]
            }
          },
          {
            "table": {
              "table_name": "cscart_categories",
              "access_type": "eq_ref",
              "possible_keys": [
                "PRIMARY",
                "p_category_id",
                "idx_categories_storefront_status",
                "idx_categories_usergroup_status",
                "idx_categories_status_id_path"
              ],
              "key": "PRIMARY",
              "used_key_parts": [
                "category_id"
              ],
              "key_length": "3",
              "ref": [
                "cscart_db.products_categories.category_id"
              ],
              "rows_examined_per_scan": 1,
              "rows_produced_per_join": 1,
              "filtered": "81.96",
              "cost_info": {
                "read_cost": "0.54",
                "eval_cost": "0.18",
                "prefix_cost": "27.81",
                "data_read_per_join": "4K"
              },
              "used_columns": [
                "category_id",
                "status",
                "storefront_id"
              ],
              "attached_condition": "((`cscart_db`.`cscart_categories`.`status` in ('A','H')) and (`cscart_db`.`cscart_categories`.`storefront_id` in (0,1)))"
            }
          },
          {
            "table": {
              "table_name": "cscart_product_sales",
              "access_type": "ref",
              "possible_keys": [
                "idx_product_sales_category_amount"
              ],
              "key": "idx_product_sales_category_amount",
              "used_key_parts": [
                "category_id",
                "product_id"
              ],
              "key_length": "6",
              "ref": [
                "cscart_db.products_categories.category_id",
                "cscart_db.c_var.product_id"
              ],
              "rows_examined_per_scan": 1,
              "rows_produced_per_join": 1,
              "filtered": "100.00",
              "using_index": true,
              "cost_info": {
                "read_cost": "0.44",
                "eval_cost": "0.18",
                "prefix_cost": "28.43",
                "data_read_per_join": "28"
              },
              "used_columns": [
                "category_id",
                "product_id",
                "amount"
              ]
            }
          },
          {
            "table": {
              "table_name": "descr1",
              "access_type": "eq_ref",
              "possible_keys": [
                "PRIMARY",
                "product_id",
                "idx_product_desc_lang",
                "idx_product_name_search",
                "idx_product_desc_sort"
              ],
              "key": "PRIMARY",
              "used_key_parts": [
                "product_id",
                "lang_code"
              ],
              "key_length": "9",
              "ref": [
                "cscart_db.c_var.product_id",
                "const"
              ],
              "rows_examined_per_scan": 1,
              "rows_produced_per_join": 1,
              "filtered": "100.00",
              "cost_info": {
                "read_cost": "1.05",
                "eval_cost": "0.18",
                "prefix_cost": "29.65",
                "data_read_per_join": "8K"
              },
              "used_columns": [
                "product_id",
                "lang_code",
                "product"
              ]
            }
          },
          {
            "table": {
              "table_name": "prices",
              "access_type": "ref",
              "possible_keys": [
                "usergroup",
                "product_id",
                "lower_limit",
                "usergroup_id",
                "idx_product_prices_usergroup_limit",
                "idx_prices_discount_lookup",
                "idx_prices_min_calc",
                "idx_prices_usergroup_lookup",
                "idx_prices_usergroup_product"
              ],
              "key": "product_id",
              "used_key_parts": [
                "product_id"
              ],
              "key_length": "3",
              "ref": [
                "cscart_db.c_var.product_id"
              ],
              "rows_examined_per_scan": 1,
              "rows_produced_per_join": 1,
              "filtered": "100.00",
              "using_index": true,
              "cost_info": {
                "read_cost": "0.44",
                "eval_cost": "0.18",
                "prefix_cost": "30.27",
                "data_read_per_join": "42"
              },
              "used_columns": [
                "product_id",
                "lower_limit",
                "usergroup_id"
              ],
              "attached_condition": "<if>(is_not_null_compl(prices), ((`cscart_db`.`prices`.`lower_limit` = 1) and (`cscart_db`.`prices`.`usergroup_id` in (0,1))), true)"
            }
          },
          {
            "table": {
              "table_name": "companies",
              "access_type": "eq_ref",
              "possible_keys": [
                "PRIMARY"
              ],
              "key": "PRIMARY",
              "used_key_parts": [
                "company_id"
              ],
              "key_length": "4",
              "ref": [
                "cscart_db.products.company_id"
              ],
              "rows_examined_per_scan": 1,
              "rows_produced_per_join": 1,
              "filtered": "100.00",
              "cost_info": {
                "read_cost": "0.38",
                "eval_cost": "0.18",
                "prefix_cost": "30.83",
                "data_read_per_join": "12K"
              },
              "used_columns": [
                "company_id",
                "status",
                "company"
              ],
              "attached_condition": "<if>(found_match(companies), ((`cscart_db`.`companies`.`status` = 'A') or (`cscart_db`.`products`.`company_id` = 0)), true)"
            }
          }
        ]
      }
    }
  }
}

Result

product_id product company_name kl_erp_inventory_id product_type parent_product_id master_product_offers_count master_product_id company_id kl_enable_qc kl_qc_amount
35990 Sebium Gel Moussant Purifying Cleansing Foaming Gel Combination To Oily Skin, 100ml Roadskye Tradecom Pvt. Ltd. P 0 0 0 13 0 0
66790 Sensibio Gel Moussant SLS Free Cleanser With Vitamin E-24h Hydration-Micellar Gel - 45ml Roadskye Tradecom Pvt. Ltd. P 0 0 0 13 0 0
35963 Atoderm Intensive Baume Ultra-soothing Balm Very dry, Sensitive to Atopic Skin 200ml Roadskye Tradecom Pvt. Ltd. P 0 0 0 13 0 0
35985 Pigmentbio sensitive areas external intimate and friction areas brightening care 75ml Roadskye Tradecom Pvt. Ltd. P 0 0 0 13 0 0
35979 Bioderma Photoderm Crème Claire SPF 50+ PA++++ Tinted Sunscreen with 8H Hydration | In Vivo Tested Roadskye Tradecom Pvt. Ltd. P 0 0 0 13 0 0
35966 Atoderm intensive gel creme for anti itching lipid replenishing treatment 75ml Roadskye Tradecom Pvt. Ltd. P 0 0 0 13 0 0
36006 Sensibio H2O Daily Soothing Cleanser, Make up Pollution & Impurities Remover Face Eyes Sensitive skin 500ml Roadskye Tradecom Pvt. Ltd. P 0 0 0 13 0 0
35999 Sensibio Defensive Rich Active Soothing Cream Hydration/Moisturisation 12h Nutrition, 40ml Roadskye Tradecom Pvt. Ltd. P 0 0 0 13 0 0
35961 Atoderm huile de douche anti irritation cleansing oil face and body moisturizer 1ltr Roadskye Tradecom Pvt. Ltd. P 0 0 0 13 0 0
35987 Sebium Face And Body Wash Moussant Purifying Cleansing Gel 45ml Roadskye Tradecom Pvt. Ltd. P 0 0 0 13 0 0
36004 Sensibio H2O Daily Soothing Cleanser, Make up Pollution & Impurities Remover Face Eyes Sensitive skin 100ml Roadskye Tradecom Pvt. Ltd. P 0 0 0 13 0 0
35993 Bioderma Sébium H2O Purifying Micellar Cleansing Water and Makeup Removing Solution for Combination to Oily Skin 250 ml Roadskye Tradecom Pvt. Ltd. P 0 0 0 13 0 0
67030 Anti-Blemish Gel Cream - Sebium Kerato+ Spot Corrector - Eliminates Pimples & Blackheads 30ml Roadskye Tradecom Pvt. Ltd. P 0 0 0 13 0 0
35977 Bioderma Photoderm Fluide Max SPF 100 PA++++ Tinted Sunscreen for Sensitive Skin | In Vivo Tested Roadskye Tradecom Pvt. Ltd. P 0 0 0 13 0 0
36005 Sensibio H2O Daily Soothing Cleanser, Make up Pollution & Impurities Remover Face Eyes Sensitive skin 250ml Roadskye Tradecom Pvt. Ltd. P 0 0 0 13 0 0
35980 Bioderma Photoderm Spot-Age SPF 50+ PA++++ Anti-Ageing Sunscreen for Dark Spots | In Vivo Tested Roadskye Tradecom Pvt. Ltd. P 0 0 0 13 0 0
68793 Sensibio Gel Moussant SLS Free Cleanser With Vitamin E-24h Hydration-Micellar Gel 100ml Roadskye Tradecom Pvt. Ltd. P 0 0 0 13 0 0
35967 Atoderm Intensive Gel moussant Ultra-Soothing Shower Gel Very Dry To Atopic Skin, 200ml Roadskye Tradecom Pvt. Ltd. P 0 0 0 13 0 0
36007 Bioderma Photoderm Crème Claire SPF 50+ PA++++ Tinted Sunscreen with 8H Hydration | In Vivo Tested Roadskye Tradecom Pvt. Ltd. P 0 0 0 13 0 0
35971 Cicabio creme repairing soothing cream irritated damaged skin baby children adult 40ml Roadskye Tradecom Pvt. Ltd. P 0 0 0 13 0 0
35973 Node G purifying shampoo for hair with tendency to oiliness 400ml Roadskye Tradecom Pvt. Ltd. P 0 0 0 13 0 0
35978 Bioderma Photoderm Aquafluide SPF 50+ PA++++ Invisible Sunscreen for All Skin Types | In Vivo Tested Roadskye Tradecom Pvt. Ltd. P 0 0 0 13 1 0
35960 Atoderm huile de douche anti irritation cleansing oil face and body moisturizer 200ml Roadskye Tradecom Pvt. Ltd. P 0 0 0 13 0 0
35995 Sebium Night Peel Smoothing Concentrate, 40ml Roadskye Tradecom Pvt. Ltd. P 0 0 0 13 0 0