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 (318) 
  AND products.product_id NOT IN (0) 
  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 
  64, 32

Query time 0.02745

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": "const",
              "possible_keys": ["PRIMARY", "p_category_id"],
              "key": "PRIMARY",
              "key_length": "3",
              "used_key_parts": ["category_id"],
              "ref": ["const"],
              "rows": 1,
              "filtered": 100,
              "using_index": true
            }
          },
          {
            "table": {
              "table_name": "products_categories",
              "access_type": "range",
              "possible_keys": ["PRIMARY", "pt"],
              "key": "PRIMARY",
              "key_length": "6",
              "used_key_parts": ["category_id", "product_id"],
              "rows": 500,
              "filtered": 1.388888836,
              "attached_condition": "products_categories.category_id = 318 and products_categories.product_id <> 0",
              "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.54700279,
              "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
20838 Unisex K163 Scarf, Lightweight and Cool Cotton Material, Designed for Both Men and Women, Bold and Edgy Color Tone, Unisex Style ÓNG heartmadeinvietnam P 0 0
41136 H'mong - Rooster And Corn Silk Scarf, Traditional Print Scarf, Designer Scarf, Soft Silk Scarf, Art-Printed Scarf Folksight P 0 0
41146 Mandarin Duck Silk Scarf, Colorful Silk Scarf, Hair Tie Silk Scarf, Neck Scarf, Gift For Relatives, Elegant Silk Scarf Folksight P 0 0
2623 K46 Silk & Cotton Scarf ÓNG heartmadeinvietnam P 0 0
37897 White Butterfly Silk Scarf, White Patterned Silk Scarf, Neck-Tie Silk Scarf, Elegant White Silk Scarf, Gift For Girlfriends Folksight P 0 0
37890 Dreamy Wings Silk Scarf, Feminine Pink Silk Scarf, Butterfly-Print Silk Scarf, Premium Designed Scarf, Versatile Satin Silk Scarf Folksight P 0 0
41126 Orange Squirrels Silk Scarf, Orange Silk Scarf, Patterned Scarf, Designer Silk Scarf, Fashion Accessory, Handbag Decoration Folksight P 0 0
41107 Pure Melody Silk Scarf, Exclusive Design Scarf, Versatile Soft Silk Scarf, Colorful Silk Scarf, Unique Patterned Scarf Folksight P 0 0
41129 Sweet Bloom Silk Scarf, Pink Silk Scarf, Feminine Silk Scarf, Shoulder Wrap Scarf, Scarf Tied As A Top Folksight P 0 0
41425 YOUTH 45cm Square Silk Scarf, Multi-purpose Scarf, Shawl, Gift for the Stylish Girl, Girlfriend's Youthful Accessory, Gift For Her MsKÉN P 0 5.00 8
36522 Small-sized Satin Headband 25.Sugaryyy P 0 5.00 1
44552 La Ha Bucket Hat, Hemp Fabric With Silk Lining, Bucket Hat With Strap, Fashion Headgear, Silk-Lined Fabric Hat, Wide-Brim Hat Hemp Oi P 0
47432 Zoro One Piece Satin Scarf, Zoro-Printed Scarf, One Piece Silk Scarf, One Piece Neck Scarf, Anime Scarf Hồng Phước Artist P 0 0
36520 3-layered Satin Facial Mask in Black 25.Sugaryyy P 0
37883 Turtle - Patterns Of The Ocean Silk Scarf, Designed Silk Scarf, Soft Silk Neck Scarf, Sailor Silk Scarf, Silk Waist Scarf, Headscarf Folksight P 0 0
37891 Floral Passion Silk Scarf, Black Patterned Silk Scarf, Embroidered Flower Silk Scarf, Feminine Style Scarf, Exclusive Design Scarf Folksight P 0 0
27368 Si La Hemp Face Mask With Silk Lining, Silk-Lined Fabric Face Mask, Mask For Sensitive Skin, Durable Fabric Mask Hemp Oi P 0
37884 Horse - Hooves In The Wind Silk Scarf, Colorful Silk Scarf, Slightly Elastic Silk Scarf, Bandana Scarf, Silk Hair Tie Folksight P 0 0
41132 Orange Rabbit Silk Scarf, Cream-Colored Silk Scarf, Art-Designed Silk Scarf, Head Wrap Scarf, Fashionable Neck Scarf, Gift For Ladies Folksight P 0 0
41118 Secret Dream Silk Scarf, Soft Silk Scarf, Girl Patterned Scarf, Shoulder Wrap Silk Scarf, Scarf Tied As A Top Folksight P 0 0
41120 Juicy Flow Silk Scarf, Patterned Silk Scarf, Hair Tie Silk Scarf, Handbag Strap Scarf, Premium Satin Silk Scarf Folksight P 0 0
37893 Early Birds Silk Scarf, High-Quality Silk Scarf, Artistic Pattern, Handcrafted Design, Brightly Colored Silk Scarf, Silk Neck Scarf Folksight P 0 0
41109 Cheerful Grace Silk Scarf, Silk Necktie Scarf, Vibrant Color Silk Scarf, Versatile Silk Scarf, Denim Scarf Tie Folksight P 0 0
47433 The Moon Satin Scarf, Satin Wrap Silk Scarf, Premium Printed Silk Scarf, Bandana Scarf, Feminine Patterned Scarf, Purple Silk Scarf Hồng Phước Artist P 0 0
47415 The Cat & Moon Satin Scarf, Red Background, Surreal Print Scarf, Premium Satin Silk Scarf, Silk Neck Wrap, Gift For Relatives Hồng Phước Artist P 0 0
47430 Cat Satin Scarf, Blue Background, Cat Print Silk Scarf, Patterned Silk Scarf, Bandana Silk Scarf, Fashion Neck Scarf Hồng Phước Artist P 0 0