SELECT 
  SQL_CALC_FOUND_ROWS products.product_id, 
  descr1.product as product, 
  companies.company as company_name, 
  SUBSTRING_INDEX(
    cscart_categories.id_path, "/", 1
  ) AS root_category, 
  user.firstname AS user_firstname, 
  user.lastname AS user_lastname, 
  user.user_id AS user_id, 
  profi_i.image_path AS avatar_image_image_path, 
  profi_i.image_x AS avatar_image_image_x, 
  profi_i.image_y AS avatar_image_image_y, 
  profi_i.is_high_res AS avatar_image_is_high_res, 
  profi_d.image_path AS avatar_detailed_image_path, 
  profi_d.image_x AS avatar_detailed_image_x, 
  profi_d.image_y AS avatar_detailed_image_y, 
  profi_d.is_high_res AS avatar_detailed_is_high_res, 
  profil.pair_id AS avatar_pair_id, 
  profil.image_id AS avatar_image_id, 
  profil.detailed_id AS avatar_detailed_id, 
  c4pcmain.unit_size as unit_size, 
  c4pcmain.unit_size * prices.price as unit_price, 
  products.paused AS paused, 
  (products.amount * prices.price) AS total_amount, 
  prices.price_piloted as price_piloted, 
  prices.price_selfplay as price_selfplay 
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 
  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_users as user ON user.user_id = (
    SELECT 
      user_id 
    FROM 
      cscart_users as tu 
    WHERE 
      tu.company_id = companies.company_id 
    LIMIT 
      1
  ) LEFT JOIN cscart_profile_images_links as profil ON user.user_id = profil.profile_id 
  AND field_name = "avatar" 
  LEFT JOIN cscart_profile_images as profi_i ON profi_i.image_id = profil.image_id 
  LEFT JOIN cscart_profile_images as profi_d ON profi_d.image_id = profil.detailed_id 
  LEFT JOIN cscart_products_categories as pcmain ON pcmain.product_id = products.product_id 
  AND pcmain.link_type = "M" 
  LEFT JOIN cscart_categories as c4pcmain ON c4pcmain.category_id = pcmain.category_id 
  LEFT JOIN cscart_product_popularity as popularity ON popularity.product_id = products.product_id 
WHERE 
  1 
  AND cscart_categories.category_id IN (
    35, 44, 62, 70, 75, 95, 114, 136, 146, 161, 
    162, 163, 164, 165, 174, 146, 147, 148, 
    149, 150, 151, 152, 153
  ) 
  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 products.paused != 'Y' 
GROUP BY 
  products.product_id 
ORDER BY 
  popularity.total desc, 
  products.product_id ASC 
LIMIT 
  0, 64

Query time 0.25401

JSON explain

{
  "query_block": {
    "select_id": 1,
    "filesort": {
      "sort_key": "popularity.total desc, products.product_id",
      "temporary_table": {
        "table": {
          "table_name": "cscart_categories",
          "access_type": "range",
          "possible_keys": ["PRIMARY", "c_status", "p_category_id"],
          "key": "PRIMARY",
          "key_length": "3",
          "used_key_parts": ["category_id"],
          "rows": 22,
          "filtered": 100,
          "index_condition": "cscart_categories.category_id in (35,44,62,70,75,95,114,136,146,161,162,163,164,165,174,146,147,148,149,150,151,152,153)",
          "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)"
        },
        "table": {
          "table_name": "products_categories",
          "access_type": "ref",
          "possible_keys": ["PRIMARY", "pt"],
          "key": "PRIMARY",
          "key_length": "3",
          "used_key_parts": ["category_id"],
          "ref": ["dev.cscart_categories.category_id"],
          "rows": 29,
          "filtered": 100,
          "using_index": true
        },
        "table": {
          "table_name": "products",
          "access_type": "eq_ref",
          "possible_keys": ["PRIMARY", "status"],
          "key": "PRIMARY",
          "key_length": "3",
          "used_key_parts": ["product_id"],
          "ref": ["dev.products_categories.product_id"],
          "rows": 1,
          "filtered": 99.53051758,
          "attached_condition": "(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.paused <> 'Y'"
        },
        "table": {
          "table_name": "companies",
          "access_type": "eq_ref",
          "possible_keys": ["PRIMARY"],
          "key": "PRIMARY",
          "key_length": "4",
          "used_key_parts": ["company_id"],
          "ref": ["dev.products.company_id"],
          "rows": 1,
          "filtered": 100,
          "attached_condition": "companies.`status` = 'A'"
        },
        "table": {
          "table_name": "user",
          "access_type": "eq_ref",
          "possible_keys": ["PRIMARY"],
          "key": "PRIMARY",
          "key_length": "3",
          "used_key_parts": ["user_id"],
          "ref": ["func"],
          "rows": 1,
          "filtered": 100,
          "attached_condition": "trigcond(`user`.user_id = (subquery#2))"
        },
        "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": ["dev.products_categories.product_id", "const"],
          "rows": 1,
          "filtered": 100,
          "attached_condition": "trigcond(descr1.lang_code = 'en')"
        },
        "table": {
          "table_name": "profil",
          "access_type": "ref",
          "possible_keys": ["profile_id"],
          "key": "profile_id",
          "key_length": "102",
          "used_key_parts": ["profile_id", "field_name"],
          "ref": ["dev.user.user_id", "const"],
          "rows": 2,
          "filtered": 100,
          "attached_condition": "trigcond(`user`.user_id = profil.profile_id and profil.field_name = 'avatar' and trigcond(`user`.user_id is not null))"
        },
        "table": {
          "table_name": "profi_i",
          "access_type": "eq_ref",
          "possible_keys": ["PRIMARY"],
          "key": "PRIMARY",
          "key_length": "4",
          "used_key_parts": ["image_id"],
          "ref": ["dev.profil.image_id"],
          "rows": 1,
          "filtered": 100,
          "attached_condition": "trigcond(trigcond(profil.image_id is not null))"
        },
        "table": {
          "table_name": "profi_d",
          "access_type": "eq_ref",
          "possible_keys": ["PRIMARY"],
          "key": "PRIMARY",
          "key_length": "4",
          "used_key_parts": ["image_id"],
          "ref": ["dev.profil.detailed_id"],
          "rows": 1,
          "filtered": 100,
          "attached_condition": "trigcond(trigcond(profil.detailed_id is not null))"
        },
        "table": {
          "table_name": "pcmain",
          "access_type": "ref",
          "possible_keys": ["link_type", "pt"],
          "key": "pt",
          "key_length": "6",
          "used_key_parts": ["product_id", "link_type"],
          "ref": ["dev.products_categories.product_id", "const"],
          "rows": 1,
          "filtered": 100,
          "attached_condition": "trigcond(pcmain.link_type = 'M')"
        },
        "table": {
          "table_name": "c4pcmain",
          "access_type": "eq_ref",
          "possible_keys": ["PRIMARY", "p_category_id"],
          "key": "PRIMARY",
          "key_length": "3",
          "used_key_parts": ["category_id"],
          "ref": ["dev.pcmain.category_id"],
          "rows": 1,
          "filtered": 100,
          "attached_condition": "trigcond(trigcond(pcmain.category_id is not null))"
        },
        "table": {
          "table_name": "popularity",
          "access_type": "eq_ref",
          "possible_keys": ["PRIMARY", "total"],
          "key": "PRIMARY",
          "key_length": "3",
          "used_key_parts": ["product_id"],
          "ref": ["dev.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.products_categories.product_id"],
          "rows": 17,
          "filtered": 100,
          "attached_condition": "prices.lower_limit = 1 and prices.usergroup_id in (0,0,1)"
        },
        "subqueries": [
          {
            "expression_cache": {
              "state": "uninitialized",
              "query_block": {
                "select_id": 2,
                "table": {
                  "table_name": "tu",
                  "access_type": "ALL",
                  "rows": 90,
                  "filtered": 100,
                  "attached_condition": "tu.company_id = companies.company_id"
                }
              }
            }
          }
        ]
      }
    }
  }
}

Result

product_id product company_name root_category user_firstname user_lastname user_id avatar_image_image_path avatar_image_image_x avatar_image_image_y avatar_image_is_high_res avatar_detailed_image_path avatar_detailed_image_x avatar_detailed_image_y avatar_detailed_is_high_res avatar_pair_id avatar_image_id avatar_detailed_id unit_size unit_price paused total_amount price_piloted price_selfplay
2459 Ulduar - Alliance Encrypticxls 43 FastGold 80 a2e272d0e12f.png 200 200 11 0 11 1.00 37.450000000000 N 18725000.0000000000
138 (EU) Chaos - Omega TiHbKaH 113 TiHbKaH 89 516aace50d41.png 199 199 9 0 9 1.00 0.660000000000 N 660.0000000000
284 Agamaggan - Alliance Encrypticxls 43 FastGold 80 a2e272d0e12f.png 200 200 11 0 11 1.00 0.370000000000 N 184992.2300000000
328 Amnennar - Alliance TiHbKaH 34 TiHbKaH 89 516aace50d41.png 199 199 9 0 9 1.00 105.000000000000 N 880571475.0000000000
185 (EU) Chaos - Cerberus Encrypticxls 113 FastGold 80 a2e272d0e12f.png 200 200 11 0 11 1.00 2.140000000000 N 534991.4400000000
1140 (PC) Settlers of Kalguur [Ruthless Hardcore] TiHbKaH 69 TiHbKaH 89 516aace50d41.png 199 199 9 0 9 1.00 0.440000000000 N 4400.0000000000
285 Agamaggan - Horde Encrypticxls 43 FastGold 80 a2e272d0e12f.png 200 200 11 0 11 1.00 0.370000000000 N 185000.0000000000
2509 Any realm - Alliance SOME SELLER 43 Nikita990 86 1.00 1.000000000000 N 500.0000000000
186 (EU) Chaos - Louisoix Encrypticxls 113 FastGold 80 a2e272d0e12f.png 200 200 11 0 11 1.00 2.140000000000 N 534991.4400000000
187 (EU) Chaos - Omega Encrypticxls 113 FastGold 80 a2e272d0e12f.png 200 200 11 0 11 1.00 2.350000000000 N 82250.0000000000
1488 Aegwynn - Alliance TiHbKaH2 43 TiHbKaH2 101 b503004dee2c.png 130 130 10 0 10 1.00 0.990000000000 N 8304607.0800000000
927 Mograine - Horde TiHbKaH 60 TiHbKaH 89 516aace50d41.png 199 199 9 0 9 1.00 0.040000000000 N 40000.0000000000
1279 (US East) Castle of Steel TiHbKaH2 61 TiHbKaH2 101 b503004dee2c.png 130 130 10 0 10 1.00 0.420000000000 N 4198.7400000000
1479 Everlook - Horde TiHbKaH2 60 TiHbKaH2 101 b503004dee2c.png 130 130 10 0 10 1.00 0.970000000000 N 485000.0000000000
118 (AP) Delos Encrypticxls 61 FastGold 80 a2e272d0e12f.png 200 200 11 0 11 1.00 5.350000000000 N 45475.0000000000
630 Gorgonnash - Alliance TiHbKaH 43 TiHbKaH 89 516aace50d41.png 199 199 9 0 9 1.00 0.210000000000 N 1761607.4700000000
332 Auberdine - Alliance TiHbKaH 34 TiHbKaH 89 516aace50d41.png 199 199 9 0 9 1.00 0.110000000000 N 922658.7700000000
908 Thekal - Alliance TiHbKaH 60 TiHbKaH 89 516aace50d41.png 199 199 9 0 9 1.00 0.040000000000 N 39997.5600000000
2188 Eonar - Horde Encrypticxls 43 FastGold 80 a2e272d0e12f.png 200 200 11 0 11 1.00 37.450000000000 N 18725000.0000000000
1135 (PC) Hardcore TiHbKaH 69 TiHbKaH 89 516aace50d41.png 199 199 9 0 9 1.00 0.440000000000 N 4400.0000000000
2512 Any realm - Alliance user_76 43 lilLol 76 55931f274f7e.png 25 25 8 0 8 1.00 0.440000000000 N 0.4400000000
1452 Thekal - Alliance TiHbKaH2 60 TiHbKaH2 101 b503004dee2c.png 130 130 10 0 10 1.00 0.970000000000 N 485000.0000000000
2420 Temple noir - Horde Encrypticxls 43 FastGold 80 a2e272d0e12f.png 200 200 11 0 11 1.00 37.450000000000 N 18725000.0000000000
934 Everlook - Alliance TiHbKaH 60 TiHbKaH 89 516aace50d41.png 199 199 9 0 9 1.00 0.040000000000 N 40000.0000000000
495 Bronze Dragonflight - Horde TiHbKaH 43 TiHbKaH 89 516aace50d41.png 199 199 9 0 9 1.00 0.210000000000 N 1761607.4700000000
286 (PS) Standard TiHbKaH 69 TiHbKaH 89 516aace50d41.png 199 199 9 0 9 1.00 0.440000000000 N 4400.0000000000
1493 Agamaggan - Horde TiHbKaH2 43 TiHbKaH2 101 b503004dee2c.png 130 130 10 0 10 1.00 0.990000000000 N 8304621.9300000000
1371 (EU) Chaos - Omega TiHbKaH2 113 TiHbKaH2 101 b503004dee2c.png 130 130 10 0 10 1.00 0.590000000000 N 52443.9200000000
329 Amnennar - Horde TiHbKaH 34 TiHbKaH 89 516aace50d41.png 199 199 9 0 9 1.00 0.110000000000 N 922746.7700000000
2096 Chants éternels - Horde Encrypticxls 43 FastGold 80 a2e272d0e12f.png 200 200 11 0 11 1.00 37.450000000000 N 18725000.0000000000
1368 (EU) Chaos - Cerberus TiHbKaH2 113 TiHbKaH2 101 b503004dee2c.png 130 130 10 0 10 1.00 0.590000000000 N 52443.9200000000
1136 (PC) Ruthless TiHbKaH 69 TiHbKaH 89 516aace50d41.png 199 199 9 0 9 1.00 0.440000000000 N 4400.0000000000
944 (AP) Delos TiHbKaH 61 TiHbKaH 89 516aace50d41.png 199 199 9 0 9 1.00 0.010000000000 N 83886.0700000000
1064 (EU) Chaos - Spriggan TiHbKaH 113 TiHbKaH 89 516aace50d41.png 199 199 9 0 9 1.00 0.660000000000 N 660.0000000000
1138 (PC) Settlers of Kalguur TiHbKaH 69 TiHbKaH 89 516aace50d41.png 199 199 9 0 9 1.00 0.440000000000 N 4400.0000000000
1153 (Xbox) Settlers of Kalguur [Ruthless Hardcore] TiHbKaH 69 TiHbKaH 89 516aace50d41.png 199 199 9 0 9 1.00 0.440000000000 N 4400.0000000000
1369 (EU) Chaos - Louisoix TiHbKaH2 113 TiHbKaH2 101 b503004dee2c.png 130 130 10 0 10 1.00 0.590000000000 N 52443.9200000000
1876 Sinstralis - Alliance TiHbKaH2 43 TiHbKaH2 101 b503004dee2c.png 130 130 10 0 10 1.00 0.990000000000 N 8304720.9300000000
2513 Any realm - Horde user_76 43 lilLol 76 55931f274f7e.png 25 25 8 0 8 1.00 0.440000000000 N 0.4400000000
791 Shattered Halls - Horde TiHbKaH 43 TiHbKaH 89 516aace50d41.png 199 199 9 0 9 1.00 0.210000000000 N 1761607.4700000000
1058 (EU) Chaos - Cerberus TiHbKaH 113 TiHbKaH 89 516aace50d41.png 199 199 9 0 9 1.00 0.660000000000 N 660.0000000000
1063 (EU) Chaos - Sagittarius TiHbKaH 113 TiHbKaH 89 516aace50d41.png 199 199 9 0 9 1.00 0.660000000000 N 660.0000000000
1116 (NA) Crystal - Diabolos TiHbKaH 113 TiHbKaH 89 516aace50d41.png 199 199 9 0 9 1.00 0.660000000000 N 660.0000000000
1159 (PC) Settlers of Kalguur [Hardcore] TiHbKaH 69 TiHbKaH 89 516aace50d41.png 199 199 9 0 9 1.00 0.710000000000 N 7100.0000000000
406 Tranzendenz - Alliance TiHbKaH 34 TiHbKaH 89 516aace50d41.png 199 199 9 0 9 1.00 0.110000000000 N 110000.0000000000
1114 (NA) Crystal - Brynhildr TiHbKaH 113 TiHbKaH 89 516aace50d41.png 199 199 9 0 9 1.00 0.660000000000 N 660.0000000000
145 (EU) Aaru Encrypticxls 61 FastGold 80 a2e272d0e12f.png 200 200 11 0 11 1.00 7.490000000000 N 3745000.0000000000
354 Firemaw - Alliance TiHbKaH 34 TiHbKaH 89 516aace50d41.png 199 199 9 0 9 1.00 0.110000000000 N 110000.0000000000
1158 (PC) Settlers of Kalguur TiHbKaH 69 TiHbKaH 89 516aace50d41.png 199 199 9 0 9 1.00 0.710000000000 N 7100.0000000000
1160 (PC) Settlers of Kalguur [Ruthless Hardcore] TiHbKaH 69 TiHbKaH 89 516aace50d41.png 199 199 9 0 9 1.00 0.710000000000 N 7100.0000000000
417 Agamaggan - Horde TiHbKaH 43 TiHbKaH 89 516aace50d41.png 199 199 9 0 9 1.00 0.210000000000 N 1761607.2600000000
340 Dragonfang - Alliance TiHbKaH 34 TiHbKaH 89 516aace50d41.png 199 199 9 0 9 1.00 0.110000000000 N 110000.0000000000
1137 (PC) Standard TiHbKaH 69 TiHbKaH 89 516aace50d41.png 199 199 9 0 9 1.00 0.440000000000 N 4400.0000000000
1982 (AP) Delos user_76 61 lilLol 76 55931f274f7e.png 25 25 8 0 8 1.00 100.000000000000 N 10000.0000000000
117 (US East) Maramma Encrypticxls 61 FastGold 80 a2e272d0e12f.png 200 200 11 0 11 1.00 5.350000000000 N 53494.6500000000
683 La Croisade écarlate - Horde TiHbKaH 43 TiHbKaH 89 516aace50d41.png 199 199 9 0 9 1.00 0.210000000000 N 1761607.4700000000
910 Jin'do - Alliance TiHbKaH 60 TiHbKaH 89 516aace50d41.png 199 199 9 0 9 1.00 0.040000000000 N 40000.0000000000
915 Mandokir - Horde TiHbKaH 60 TiHbKaH 89 516aace50d41.png 199 199 9 0 9 1.00 0.040000000000 N 40000.0000000000
921 Lakeshire - Horde TiHbKaH 60 TiHbKaH 89 516aace50d41.png 199 199 9 0 9 1.00 0.040000000000 N 40000.0000000000
924 Auberdine - Alliance TiHbKaH 60 TiHbKaH 89 516aace50d41.png 199 199 9 0 9 1.00 0.040000000000 N 40000.0000000000
932 Earthshaker - Alliance TiHbKaH 60 TiHbKaH 89 516aace50d41.png 199 199 9 0 9 1.00 0.040000000000 N 40000.0000000000
1065 (EU) Light - Alpha TiHbKaH 113 TiHbKaH 89 516aace50d41.png 199 199 9 0 9 1.00 0.660000000000 N 660.0000000000
1145 (PS) Settlers of Kalguur [Hardcore] TiHbKaH 69 TiHbKaH 89 516aace50d41.png 199 199 9 0 9 1.00 0.440000000000 N 4400.0000000000
1276 (SA) Devaloka TiHbKaH2 61 TiHbKaH2 101 b503004dee2c.png 130 130 10 0 10 1.00 0.420000000000 N 4200.0000000000