SELECT 
  SQL_CALC_FOUND_ROWS products.product_id, 
  IF(
    shared_descr.product_id IS NOT NULL, 
    shared_descr.product, descr1.product
  ) as product, 
  stoc_intern, 
  pret_achizitie, 
  pret_revanzator, 
  gestiune 
FROM 
  cscart_products as products 
  LEFT JOIN cscart_product_options_inventory as inventory ON inventory.product_id = products.product_id 
  LEFT JOIN cscart_product_descriptions as descr1 ON descr1.product_id = products.product_id 
  AND descr1.lang_code = 'ro' 
  LEFT JOIN cscart_product_prices as prices ON prices.product_id = products.product_id 
  AND prices.lower_limit = 1 
  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') 
  LEFT JOIN cscart_ult_product_descriptions shared_descr ON shared_descr.product_id = products.product_id 
  AND shared_descr.company_id = 1 
  AND shared_descr.lang_code = 'ro' 
  LEFT JOIN cscart_product_popularity as popularity ON popularity.product_id = products.product_id 
WHERE 
  1 
  AND cscart_categories.category_id IN (42631) 
  AND cscart_categories.company_id = 1 
  AND (
    CASE products.tracking WHEN 'O' THEN inventory.amount > 0 WHEN 'B' THEN products.amount > 0 ELSE 1 END
  ) 
  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) 
GROUP BY 
  products.product_id 
ORDER BY 
  popularity.total desc, 
  product_id ASC 
LIMIT 
  0, 64

Query time 0.03084

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "201.75"
    },
    "ordering_operation": {
      "using_filesort": true,
      "grouping_operation": {
        "using_temporary_table": true,
        "using_filesort": false,
        "nested_loop": [
          {
            "table": {
              "table_name": "inventory",
              "access_type": "system",
              "possible_keys": [
                "pc"
              ],
              "rows_examined_per_scan": 0,
              "rows_produced_per_join": 1,
              "filtered": "0.00",
              "const_row_not_found": true,
              "cost_info": {
                "read_cost": "0.00",
                "eval_cost": "0.10",
                "prefix_cost": "0.00",
                "data_read_per_join": "880"
              },
              "used_columns": [
                "product_id",
                "amount"
              ]
            }
          },
          {
            "table": {
              "table_name": "cscart_categories",
              "access_type": "const",
              "possible_keys": [
                "PRIMARY",
                "c_status",
                "p_category_id"
              ],
              "key": "PRIMARY",
              "used_key_parts": [
                "category_id"
              ],
              "key_length": "3",
              "ref": [
                "const"
              ],
              "rows_examined_per_scan": 1,
              "rows_produced_per_join": 1,
              "filtered": "100.00",
              "cost_info": {
                "read_cost": "0.00",
                "eval_cost": "0.10",
                "prefix_cost": "0.00",
                "data_read_per_join": "2K"
              },
              "used_columns": [
                "category_id",
                "company_id",
                "usergroup_ids",
                "status"
              ]
            }
          },
          {
            "table": {
              "table_name": "products_categories",
              "access_type": "ref",
              "possible_keys": [
                "PRIMARY",
                "pt"
              ],
              "key": "PRIMARY",
              "used_key_parts": [
                "category_id"
              ],
              "key_length": "3",
              "ref": [
                "const"
              ],
              "rows_examined_per_scan": 777,
              "rows_produced_per_join": 777,
              "filtered": "100.00",
              "using_index": true,
              "cost_info": {
                "read_cost": "2.11",
                "eval_cost": "77.70",
                "prefix_cost": "79.81",
                "data_read_per_join": "12K"
              },
              "used_columns": [
                "product_id",
                "category_id"
              ]
            }
          },
          {
            "table": {
              "table_name": "products",
              "access_type": "eq_ref",
              "possible_keys": [
                "PRIMARY",
                "status"
              ],
              "key": "PRIMARY",
              "used_key_parts": [
                "product_id"
              ],
              "key_length": "3",
              "ref": [
                "maniamall_cscart.products_categories.product_id"
              ],
              "rows_examined_per_scan": 1,
              "rows_produced_per_join": 38,
              "filtered": "5.00",
              "cost_info": {
                "read_cost": "0.00",
                "eval_cost": "3.89",
                "prefix_cost": "157.51",
                "data_read_per_join": "169K"
              },
              "used_columns": [
                "product_id",
                "status",
                "amount",
                "usergroup_ids",
                "tracking",
                "stoc_intern",
                "pret_achizitie",
                "pret_revanzator",
                "gestiune"
              ],
              "attached_condition": "((0 <> (case `maniamall_cscart`.`products`.`tracking` when 'O' then <cache>((NULL > 0)) when 'B' then (`maniamall_cscart`.`products`.`amount` > 0) else 1 end)) and ((`maniamall_cscart`.`products`.`usergroup_ids` = '') or (0 <> find_in_set(0,`maniamall_cscart`.`products`.`usergroup_ids`)) or (0 <> find_in_set(1,`maniamall_cscart`.`products`.`usergroup_ids`))) and (`maniamall_cscart`.`products`.`status` = 'A'))"
            }
          },
          {
            "table": {
              "table_name": "shared_descr",
              "access_type": "eq_ref",
              "possible_keys": [
                "PRIMARY",
                "product_id",
                "company_id"
              ],
              "key": "PRIMARY",
              "used_key_parts": [
                "product_id",
                "lang_code",
                "company_id"
              ],
              "key_length": "13",
              "ref": [
                "maniamall_cscart.products_categories.product_id",
                "const",
                "const"
              ],
              "rows_examined_per_scan": 1,
              "rows_produced_per_join": 38,
              "filtered": "100.00",
              "cost_info": {
                "read_cost": "0.00",
                "eval_cost": "3.89",
                "prefix_cost": "161.40",
                "data_read_per_join": "148K"
              },
              "used_columns": [
                "product_id",
                "lang_code",
                "company_id",
                "product"
              ]
            }
          },
          {
            "table": {
              "table_name": "descr1",
              "access_type": "eq_ref",
              "possible_keys": [
                "PRIMARY",
                "product_id"
              ],
              "key": "PRIMARY",
              "used_key_parts": [
                "product_id",
                "lang_code"
              ],
              "key_length": "9",
              "ref": [
                "maniamall_cscart.products_categories.product_id",
                "const"
              ],
              "rows_examined_per_scan": 1,
              "rows_produced_per_join": 38,
              "filtered": "100.00",
              "cost_info": {
                "read_cost": "0.00",
                "eval_cost": "3.89",
                "prefix_cost": "165.28",
                "data_read_per_join": "148K"
              },
              "used_columns": [
                "product_id",
                "lang_code",
                "product"
              ]
            }
          },
          {
            "table": {
              "table_name": "popularity",
              "access_type": "eq_ref",
              "possible_keys": [
                "PRIMARY",
                "total"
              ],
              "key": "PRIMARY",
              "used_key_parts": [
                "product_id"
              ],
              "key_length": "3",
              "ref": [
                "maniamall_cscart.products_categories.product_id"
              ],
              "rows_examined_per_scan": 1,
              "rows_produced_per_join": 38,
              "filtered": "100.00",
              "cost_info": {
                "read_cost": "0.00",
                "eval_cost": "3.89",
                "prefix_cost": "169.17",
                "data_read_per_join": "1K"
              },
              "used_columns": [
                "product_id",
                "total"
              ]
            }
          },
          {
            "table": {
              "table_name": "prices",
              "access_type": "ref",
              "possible_keys": [
                "usergroup",
                "product_id",
                "lower_limit",
                "usergroup_id"
              ],
              "key": "product_id",
              "used_key_parts": [
                "product_id"
              ],
              "key_length": "3",
              "ref": [
                "maniamall_cscart.products_categories.product_id"
              ],
              "rows_examined_per_scan": 1,
              "rows_produced_per_join": 9,
              "filtered": "25.00",
              "using_index": true,
              "cost_info": {
                "read_cost": "28.70",
                "eval_cost": "0.97",
                "prefix_cost": "201.75",
                "data_read_per_join": "233"
              },
              "used_columns": [
                "product_id",
                "lower_limit",
                "usergroup_id"
              ],
              "attached_condition": "((`maniamall_cscart`.`prices`.`lower_limit` = 1) and (`maniamall_cscart`.`prices`.`usergroup_id` in (0,0,1)))"
            }
          }
        ]
      }
    }
  }
}

Result

product_id product stoc_intern pret_achizitie pret_revanzator gestiune
687122 Hamac Brazilian tip Scaun Deluxe pentru Casa, Curte sau Gradina, Capacitate 120kg, multicolor -99 77.86 93.03 Y
480529 Proiector Lampa Rotunda pentru Studio Foto, Putere 40W, Lumina Alb Rece 5600k -99 180.99 213.00 Y
1133394 Hamac Brazilian tip Scaun Suspendat pentru Curte sau Gradina, 100x100cm, Portocaliu/Rosu -99 45.62 40.99 Y
1108257 Folie Protectie Faruri/Stopuri Light Black 60x60cm ManiaCars -99 34.51 45.00 Y
1114057 Purificator Aer Auto Carruzzo, cu Functie de Ionizare, Filtru de carbon, Eficienta 3.6mp -99 103.66 114.37 Y
612918 Huse auto compatibile Logan I nefractionat MATERIAL ROMB ManiaCars -99 270.00 0.00 Y
431479 Termometru alimentar electronic tip pin cu afisaj LCD, temperaturi masurare intre -50 si 300 grade -99 11.42 32.00 Y
1108259 Folie Protectie Faruri/Stopuri Rosie 60x60cm ManiaCars -99 34.50 45.00 Y
1108324 Lanterna LED COB U3 cu ZOOM, 9W, impermeabila, 6 moduri de iluminare, cu suport de bicicleta -99 55.11 62.79 Y
1108375 Folie geamuri auto omologata neprofesionala 5% transparenta ( Low Cost ) -99 48.23 0.00 Y
1192887 Set 4 fluturasi badminton, dimensiune 8x6.5 cm, multicolor -99 2.56 2.83 Y
1108255 Folie Protectie Faruri/Stopuri Dark Black 60x60cm ManiaCars -99 34.51 45.00 Y
698147 LED SMD 5050 lumina albastra ManiaCars -99 0.14 0.00 Y
1005477 CONEXPANDURI ANCORA DUBLA CU TIJA M20/27X250MM, 3/SET Profi Tools -99 100.44 0.00 Y
1005469 CONEXPANDURI ANCORA DUBLA CU TIJA M16/25X250MM, 5/SET Profi Tools -99 102.28 0.00 Y
600012 Carcasa cheie auto cu 3 butoane FO-113, compatibil Ford AllCars -99 24.38 0.00 Y
696950 Folie caroserie CROM MAT PORTOCALIU 1 x 1.52cm COD: 1612B ManiaCars -99 44.99 0.00 Y
695183 Bec bord 12V 1,2W (set 10 buc) ManiaCars -99 3.50 0.00 Y
621062 Carcasa cheie auto briceag cu 3 butoane rotunde + buton panica VW-124, compatibila Volkswagen, Seat, Skoda AllCars -99 18.00 0.00 Y
620876 Carcasa cheie auto briceag cu 2 butoane pentru transformare, compatibil Peugeot PE-141 AllCars -99 30.00 0.00 Y
697432 Covoare cauciuc RENAULT KADJAR 2015-> ( 546658 P40 ) ManiaCars -99 96.95 0.00 Y
621045 Carcasa cheie auto cu loc pentru cip si led VW-107, compatibila Volkswagen, Seat, Skoda AllCars -99 19.29 0.00 Y
620921 Carcasa cheie auto cu 2 butoane, compatibila Porsche PO-101 AllCars -99 70.00 0.00 Y
620902 Carcasa cheie auto briceag cu 3 butoane, buton portbagaj si lamela laser, fara suport baterie, compatibila Peugeot PE-132 AllCars -99 21.49 0.00 Y
600132 Carcasa Smart cheie auto LR-113, compatibil Land Rover AllCars -99 80.00 0.00 Y
697717 Bec bord dulie plastic 24V, 1.2W (pret 10buc) ManiaCars -99 10.00 0.00 Y
600044 Carcasa cheie auto HO-100 cu loc cip, compatibil Honda AllCars -99 24.57 0.00 Y
614824 Lampa laterala cu 9 SMD 12V PORTOCALIU GN13 ManiaCars -99 5.40 0.00 Y
621019 Carcasa cheie auto briceag cu 3 butoane si lamela TOY43, compatibila Toyota TO-130 AllCars -99 33.00 0.00 Y
600112 Carcasa cheie auto de transformat, briceag cu 3 butoane KI-114, compatibil Kia AllCars -99 43.04 0.00 Y
697903 Lampa gabarit 14 X 15 de 24V ManiaCars -99 9.90 0.00 Y
992455 Deflector capota SKODA OCTAVIA 2011-> ( REINHD751 ) DEF2 Mall -99 108.00 0.00 Y
600286 Carcasa cheie auto cu 2 butoane si Lamela HU43 pentru transformat, compatibil Opel OP-150 AllCars -99 35.81 0.00 Y
991897 Husa volan LUX FST01 cu ac si ata piele cu gaurele marime: L Culoare: negru Mall -99 27.00 0.00 Y
621108 Carcasa cheie auto cu 3 butoane mari CRY-102, compatibila Chrysler AllCars -99 50.00 0.00 Y
1000097 CHEIE TUBULARA IMPACT JANTE ALIAJ CR-MO 1/2 22MM" Profi Tools -99 50.42 0.00 Y
1083988 Kit instalatie Xenon HID Canbus HB4 9006, 6000K 55W -99 271.82 273.00 Y
999893 CLESTE FIXARE TIP W CU BLOCARE 225MM Profi Tools -99 22.49 0.00 Y
1006365 SURUBURI METRICE CU CAP HEXAGONAL M12X55 MM, 50/SET Profi Tools -99 39.31 0.00 Y
1123986 Ridicator tensiune pentru FIR NEON PREMIU 12-24V TopCars -99 25.35 0.00 Y
1282930 Folie geamuri auto omologata neprofesionala 20% transparenta ( Low Cost ) -99 37.24 43.00 Y
1108822 Folie Carbon 3D Gri antracit, 1x1,5m, Tehnologie de Eliminare a Bulelor de Aer -99 27.00 45.00 Y
1158435 Suport umbrela, forma patrata, diametru 10 cm, 74x74x14 cm, culoare gri -99 61.24 68.33 Y
1108819 Folie Carbon 3D Alb, 1x1.5m, Tehnologie de Eliminare a Bulelor de Aer -99 14.41 45.00 Y
1108820 Folie Carbon 3D Albastru, 1x1.5m, Tehnologie de Eliminare a Bulelor de Aer -99 27.01 45.00 Y
1153203 Rama Adaptoare 2DIN compatibil Kia Sportage 2016-, Negru -99 118.07 137.88 Y
1282939 Bec o faza TV BA15S 5630 18SMD Alb Canbus 9v-30v nonpolar TopCars -99 14.41 20.00 Y
1283561 Manusi imersate in PVC, 350 mm, marime XL Brico DecoHome -99 9.63 18.00 Y
1283295 Prezoane jante aluminiu cu lungime de 45mm, M14x1.25 -99 9.16 0.00 Y
1283299 Prezoane jante aluminiu lungime 50 mm, M14x1.25 -99 9.22 0.00 Y
1129290 Lamela cheie valet Mercedes, cod Lml188 - LCV82430 -99 10.00 0.00 Y
1590985 Inexistent emag -99 0.00 0.00 Y
1228395 Protectie jante 8m ManiaCars -99 13.52 0.00 Y
1707787 Inexistent emag -99 8.00 0.00 Y
1181767 Carcasa Cheie Briceag VW 3 Butoane Model Nou BRE3234 - CCB63776 -99 30.00 0.00 Y
1167142 Maner schimbator compatibil DACIA DUSTER cu 6 viteze BK87054 VistaCar -99 27.00 0.00 Y