SELECT 
  SQL_CALC_FOUND_ROWS products.product_id, 
  descr1.product as product, 
  companies.company as company_name, 
  products.product_type, 
  products.parent_product_id, 
  cscart_product_review_prepared_data.average_rating average_rating, 
  cscart_product_review_prepared_data.reviews_count product_reviews_count 
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 
  LEFT JOIN cscart_product_review_prepared_data ON cscart_product_review_prepared_data.product_id = products.product_id 
  AND cscart_product_review_prepared_data.storefront_id = 0 
  LEFT JOIN cscart_product_popularity as popularity ON popularity.product_id = products.product_id 
WHERE 
  1 
  AND cscart_categories.category_id IN (
    99, 141, 142, 143, 144, 145, 146, 149, 
    150, 151, 152, 153
  ) 
  AND companies.status IN ('A') 
  AND (
    products.amount > 0 
    OR products.tracking = 'D'
  ) 
  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 
GROUP BY 
  products.product_id 
ORDER BY 
  popularity.total desc, 
  products.product_id ASC 
LIMIT 
  640, 32

Query time 0.60790

JSON explain

{
  "query_block": {
    "select_id": 1,
    "filesort": {
      "sort_key": "popularity.total desc, products.product_id",
      "temporary_table": {
        "nested_loop": [
          {
            "table": {
              "table_name": "cscart_categories",
              "access_type": "range",
              "possible_keys": ["PRIMARY", "p_category_id"],
              "key": "PRIMARY",
              "key_length": "3",
              "used_key_parts": ["category_id"],
              "rows": 12,
              "filtered": 100,
              "attached_condition": "cscart_categories.category_id in (99,141,142,143,144,145,146,149,150,151,152,153)",
              "using_index": true
            }
          },
          {
            "table": {
              "table_name": "products_categories",
              "access_type": "ref",
              "possible_keys": ["PRIMARY", "pt"],
              "key": "PRIMARY",
              "key_length": "3",
              "used_key_parts": ["category_id"],
              "ref": ["dev_db.cscart_categories.category_id"],
              "rows": 359,
              "filtered": 100,
              "using_index": true
            }
          },
          {
            "table": {
              "table_name": "products",
              "access_type": "eq_ref",
              "possible_keys": ["PRIMARY", "status", "idx_parent_product_id"],
              "key": "PRIMARY",
              "key_length": "3",
              "used_key_parts": ["product_id"],
              "ref": ["dev_db.products_categories.product_id"],
              "rows": 1,
              "filtered": 18.48341942,
              "attached_condition": "products.parent_product_id = 0 and (products.amount > 0 or products.tracking = 'D') and (products.usergroup_ids = '' or find_in_set(0,products.usergroup_ids) or find_in_set(1,products.usergroup_ids)) and products.`status` = 'A'"
            }
          },
          {
            "table": {
              "table_name": "companies",
              "access_type": "eq_ref",
              "possible_keys": ["PRIMARY"],
              "key": "PRIMARY",
              "key_length": "4",
              "used_key_parts": ["company_id"],
              "ref": ["dev_db.products.company_id"],
              "rows": 1,
              "filtered": 100,
              "attached_condition": "companies.`status` = 'A'"
            }
          },
          {
            "table": {
              "table_name": "descr1",
              "access_type": "eq_ref",
              "possible_keys": ["PRIMARY", "product_id"],
              "key": "PRIMARY",
              "key_length": "11",
              "used_key_parts": ["product_id", "lang_code"],
              "ref": ["dev_db.products_categories.product_id", "const"],
              "rows": 1,
              "filtered": 100,
              "attached_condition": "trigcond(descr1.lang_code = 'en')"
            }
          },
          {
            "table": {
              "table_name": "cscart_product_review_prepared_data",
              "access_type": "eq_ref",
              "possible_keys": ["PRIMARY"],
              "key": "PRIMARY",
              "key_length": "7",
              "used_key_parts": ["product_id", "storefront_id"],
              "ref": ["dev_db.products_categories.product_id", "const"],
              "rows": 1,
              "filtered": 100
            }
          },
          {
            "table": {
              "table_name": "popularity",
              "access_type": "eq_ref",
              "possible_keys": ["PRIMARY", "total"],
              "key": "PRIMARY",
              "key_length": "3",
              "used_key_parts": ["product_id"],
              "ref": ["dev_db.products_categories.product_id"],
              "rows": 1,
              "filtered": 100
            }
          },
          {
            "table": {
              "table_name": "prices",
              "access_type": "ref",
              "possible_keys": [
                "usergroup",
                "product_id",
                "lower_limit",
                "usergroup_id"
              ],
              "key": "product_id",
              "key_length": "3",
              "used_key_parts": ["product_id"],
              "ref": ["dev_db.products_categories.product_id"],
              "rows": 1,
              "filtered": 99.9960556,
              "attached_condition": "prices.lower_limit = 1 and prices.usergroup_id in (0,0,1)"
            }
          }
        ]
      }
    }
  }
}

Result

product_id product company_name product_type parent_product_id average_rating product_reviews_count
41386 Fern, Pink Snowy Resin And Wooden Hair Stick, Delicate Design, Durable Wood Material, Unique Sculpting Technique, Feminine Hair Accessory Trâm cài tóc BHK Việt Nam P 0
47868 Blue Star Shoe Chain Style 06, Starry Night Collection, Unique Handmade Accessory, Mystical And Captivating Design EVRIES P 0
47887 Extreme 01 White Necklace, Milky Way Collection, Elegant Design, Subtle Colors, Easy To Match With Any Style EVRIES P 0
48497 Extreme 04 Bracelet, Du Xuan Collection, Youthful And Fashionable Design, Lovely Gift For Sweet Girls EVRIES P 0
44876 Floral Fabric Headband, Cute Pattern, Bright Colors, Vintage Style, A Gift For Gentle And Feminine Girls Gian hàng HMT P 0 0
43477 Calfskin Golf Ball Holder, Premium Material, Traditional Handcrafted, Luxurious Accessory, Smart and Convenient Design ELEGENT P 0 0
47499 Cotton Flowers Embroidered Linen Bow Hair Tie, Wine Red Color, Perfect For Christmas Photoshoots, Sweet And Feminine Style Miti Flowers P 0
47862 Extreme 01 Blue Star Necklace, Starry Night Collection, Unique Design, Beautiful Color Combination, Youthful And Dynamic Style EVRIES P 0
45292 Mix Round Clay Earrings, Bold and Edgy Large-sized Earrings, Impressive Accessories, Harmonious Colors, Eye-catching DHDHbeauty P 0
35886 Black Mussel Shell Necklace, Natural Black Mother of Pearl Material, Bold Adventure Design, Unique Color-changing Effect EMOI Jewelry P 0 0
36519 Floral Linen Scrunchie 25.Sugaryyy P 0 0
35695 Tides Earrings, Sea Lover Collection, Inspired by the Ocean, Oval-shaped Pendants, Stylish and Edgy Beauty, Suitable for Various Outfits EMOI Jewelry P 0
35712 Bliss Earrings, Trendsetter Collection, Simple Design, Cute Color Palette, Eye-catching, Enhances Facial Features EMOI Jewelry P 0 0
33466 Scrunchie With Lovely Illustrations, Pretty Patterns, Gentle Colors, Feminine Style, Non-Damaging to Hair Gemmyn's Adventure P 0 0
44512 Random Color Bow Tie Fabric Hair Tie, Durable Hair Tie, Doesn't Cause Hair Loss, Cute Hair Accessory, Lovely Bow Design Gian hàng HMT P 0
45254 Ruffle Fabric Headband, 2cm Band, Meticulously Stitched and Secure, Sweet Colors, Minimalist Design, Handmade Hair Accessory Gian hàng HMT P 0
47651 Summer Fruit Embroidered Hair Clip, Triangular Hair Clip, Eye-Catching And Adorable Patterns, Bright Colors, Handmade Hair Clip Jumie Handmade P 0 0
47858 Colorful Bracelet Style Extreme 03, Smile Away Collection, White Bead Embellishments, Multi-Colored Smiley Face Charms, Energetic Style EVRIES P 0
47856 Colorful Long Form Necklace Style 01, Smile Away Collection, Multi-Colored Smiley Face Charms, Youthful And Playful Style EVRIES P 0
47889 Extreme 03 White Necklace, Milky Way Collection, Graceful Beauty, Fairy-Like Style, Sweet And Delicate Design EVRIES P 0
35696 Lighthouse Earrings, Sea Lover Collection, Pure White Color, Large Rectangular Pendants, Impressive Design, Inspired by the Ocean EMOI Jewelry P 0
48858 Linen Tied Bow Pin Size M, Fabric Hair Pin, Hair Accessories, Handmade Accessories, Fabric Accessories, Gifts for Girls, Gifts for Girlfriends, Unique Gifts Giggle Handmade P 0
47861 Colorful Shoe Chain Style 06, Smile Away Collection, Unique Shoe Accessory, Eye-Catching, Perfect Gift For Shoe Lovers EVRIES P 0
48866 Fabric Animal Hat, Fabric Hat, Hair Accessories, Handmade Accessories, Fabric Accessories, Gifts for Girls, Unique Gifts Giggle Handmade P 0
48954 Handmade Clay Small Penguin Keychain, Clay Keychain, Handmade Clay, Unique Gifts, Handmade Gifts, Handmade Keychains DONGLAI.ILLUSTRATION P 0
48551 Phoenix, 90cm Square Silk Scarf With Hand-Rolled Hem - MsKEN MsKÉN P 0
45293 Flower Round Clay Earrings, Meticulous Attention to Detail, Elegant Design, Perfect Choice for Accessories Enthusiasts DHDHbeauty P 0 0
40538 Yellow Persimmon Ribbons, Girls Accessories Set, Vibrant Yellow Color, Enhances Child's Adorableness, Lovely Gift for Girls Hana Mascot P 0 0
47860 Colorful Mask Strap Style 05, Smile Away Collection, Adorned With Charming Charms, Unique Handmade Accessory, Youthful Style EVRIES P 0
47179 Houndstooth Necklace, Elegant and Versatile Beauty, Youthful Style, Suitable for Various Outfits, Easy to Maintain Theo Jewelry P 0
47859 Simple Colorful Bracelet Style 04, Smile Away Collection, Playful And Youthful Design, Cute Handmade Gift For Girls EVRIES P 0
40537 Artichoke Ribbons, Girls Accessories Set, Green Color, Cute Design, High-Quality Material, Doesn't Cause Discomfort to Child's Scalp Hana Mascot P 0 0