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 (
    101, 313, 341, 163, 165, 166, 168, 169, 
    171, 340
  ) 
  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 
  768, 32

Query time 0.36641

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": 10,
              "filtered": 100,
              "attached_condition": "cscart_categories.category_id in (101,313,341,163,165,166,168,169,171,340)",
              "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
46272 TORN, Hand Drawn Abstract Painting, Strong And Broken Brush Strokes, Diverse Color Palette, Interesting Focal Point For Art Space Him Him Art P 0
37413 Cat Tilting Head Porcelain Figurine, Handmade Ceramic Statue, Ideal For Decorating Study Or Work Desks, Charming Handmade Gift Art by Hang P 0 0
36765 Scented Melt Wax, Pack of 6 ADORA P 0 0
40367 Ben Thanh Market, Woodcut Artprint, Familiar Saigon Landscape, Vietnamese Scenery, Digital Print Artistry Saigon Print Shop P 0
47967 Handmade Relaxing Scented Candle, 120G, Natural Soy Wax Candle, Natural Relaxation At Its Finest, Perfect Gift For Women, Gift Candle, Gift Idea Being home P 0 5.00 4
47594 Handmade Paper Flower Painting - Poppy With Dó Paper MAYPAPERFLOWER 30x40cm Wooden Frame Maypaperflower P 0
35486 Peace Scented Candle Lá Nhỏ - Home sweet scents P 0 5.00 1
828 Soy Wax Tin Candles Leviter P 0 5.00 2
37420 Sleeping Cat Porcelain Figurine, Handmade Cat-Shaped Statue, Premium Glossy Glazed Ceramic, Decorating Office Or Study Desk Corners Art by Hang P 0 0
33281 Sea Salt & Ginger Soap, Purifies and Detoxifies the Skin, Antioxidant Properties, Softens and Smoothens the Skin, Revitalizes the Skin Odes Naturelles P 0
35642 Macrame Stool Cover, Impressive Patterns, Rustic Material, Machine Washable, Creates Accent for the Room Thừng Gỗ Decor P 0 5.00 1
33360 A Spa Day Scented Candle, The Basic Collection JAROS Candle P 0
27923 Dotty Ceramic Cup, 2 Color Options, Striking and Eye-Catching Design, Vietnamese Ceramic, High-Quality Handcrafted Product The Goods P 0
32435 Garden No.1, Decorative Art Print, Size A3 / A4, Included Frame, Lush Green Garden Full of Life, Artistic Highlight Nhu Pham Art P 0 0
32404 Square Ceramic Plate, Handmade Ceramic Plate, Ceramic Tableware, Vietnamese Ceramics, Elegant Dinnerware, Timeless Design, Square Plate Lina Pottery by Minh Tien Ceramic P 0 5.00 6
32327 Simple Checkered Pattern Ceramic Vase, Vietnamese Ceramics, Handmade Vase, Home Decor, Minimalist Ceramic Vase, Housewarming Gift, Wedding Gift Lina Pottery by Minh Tien Ceramic P 0 5.00 1
32324 Dog Shaped With Pointy Ears Ceramic Piggy Bank, Vietnamese Ceramics, Unique Piggy Bank, Ceramic Money Bank, Handmade, Gift Ideas, Home Decor Lina Pottery by Minh Tien Ceramic P 0 5.00 6
33198 Christmas Coaster, Good Absorbency, Made of Cotton Yarn, High Durability, Intricate Hand-Knitting Technique, Festival Decoration BOUTIQUE 29 P 0 5.00 1
826 Macrame Baby Swing, Premium Cotton Material, Securely Woven, Equipped with High Protective Padding for Baby's Safety Artspace P 0 0
31865 Lavender Dó Paper Fan, Cute Doll Patterns, Premium Quality Material, Exclusive Design, Handcrafted Product Hana Mascot P 0
40928 Scented Candles Gift Set OnaTree - Vietnamese Cosmetics P 0 5.00 6
47280 Crochet Christmas Gnome - Nha An Hanoi, Noel Decorative Accessories, Handmade Crochet Accessories, Unique Christmas Gifts Nhã An Hanoi P 0 0
27934 Mint Green Ceramic Cup, Refreshing Green Color, Coated with High-Quality Glaze, Excellent Heat Resistance, Safe to Use, Vietnamese Ceramic The Goods P 0
40365 Sleeping “Xich Lo” Hoi An, Woodcut Artprint, Simple Beauty, Work Ethic Charm, Decorative Painting, Print Artistry Saigon Print Shop P 0
35655 Leaves Shaped Macrame Wall Hanging, Size 60x60cm, Classic Style, Harmonious Blend of Dark and Light Colors, Artistic Masterpiece Thừng Gỗ Decor P 0 0
46271 GOLDEN HOUR, Hand Drawn Abstract Painting, One-Of-A-Kind Hand-Painted Artwork, Acrylic On Canvas Material, Abstract Style Him Him Art P 0
31735 White Canvas Hammock, Natural and Soft Material, Strong Weight Capacity, Safe to Use, Suitable for Various Spaces MIDUME P 0 0
32307 Bich Tuyen Ceramic Vase, Vietnamese Ceramics, Handmade Vase, Decorative Vase, Home Decor, Vietnamese Vase, Housewarming Gift, Wedding Gift Lina Pottery by Minh Tien Ceramic P 0 5.00 6
816 One-Tier Hanging Macrame Shelf, Natural Pine Wood, Premium Cotton Knot Pattern, Space-Saving, Charming Accent for Home Artspace P 0 0
29816 Plain Table Runner, Elegant Color Combination, Easy to Clean, Durable Material, Elevates Kitchen Space Soft&another Home P 0 0
45361 Wooden Cat-shaped Plate, Cute Cat Face Design, Decorative Tray, Meticulously Crafted, Resistant to Insects, Adorable Decor Item LIDEE HAUS P 0 0
35652 Two-Tier Macrame Wall Hanging Shelf, Vintage-inspired, High Durability, Elegant and Unique Design, Suitable for Various Spaces Thừng Gỗ Decor P 0