SELECT 
  cscart_categories.category_id, 
  cscart_categories.parent_id, 
  cscart_categories.id_path, 
  cscart_category_descriptions.category, 
  cscart_categories.position, 
  cscart_categories.status, 
  cscart_categories.company_id, 
  cscart_categories.storefront_id, 
  cscart_seo_names.name as seo_name, 
  cscart_seo_names.path as seo_path, 
  cscart_categories.age_verification, 
  cscart_categories.age_limit, 
  cscart_category_descriptions.age_warning_message 
FROM 
  cscart_categories 
  LEFT JOIN cscart_category_descriptions ON cscart_categories.category_id = cscart_category_descriptions.category_id 
  AND cscart_category_descriptions.lang_code = 'en' 
  LEFT JOIN cscart_seo_names ON cscart_seo_names.object_id = cscart_categories.category_id 
  AND cscart_seo_names.type = 'c' 
  AND cscart_seo_names.dispatch = '' 
  AND cscart_seo_names.lang_code = 'en' 
WHERE 
  1 = 1 
  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') 
  AND cscart_categories.parent_id IN (0) 
  AND cscart_categories.category_id != 1 
  AND cscart_categories.parent_id != 1 
  AND cscart_categories.storefront_id IN (0, 1) 
  AND cscart_categories.category_id IN (
    SELECT 
      DISTINCT pc.category_id 
    FROM 
      cscart_products_categories AS pc 
      INNER JOIN cscart_products AS pd ON pd.product_id = pc.product_id 
      AND pd.status = 'A' 
      AND pd.company_id = 36
  ) 
ORDER BY 
  cscart_categories.is_trash asc, 
  cscart_categories.position asc, 
  cscart_category_descriptions.category asc 
LIMIT 
  0, 10

Query time 0.00157

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost": 0.472528571,
    "filesort": {
      "sort_key": "cscart_categories.is_trash, cscart_categories.position, cscart_category_descriptions.category",
      "temporary_table": {
        "nested_loop": [
          {
            "table": {
              "table_name": "cscart_categories",
              "access_type": "range",
              "possible_keys": ["PRIMARY", "c_status", "parent", "p_category_id"],
              "key": "parent",
              "key_length": "3",
              "used_key_parts": ["parent_id"],
              "loops": 1,
              "rows": 21,
              "cost": 0.0162338,
              "filtered": 100,
              "index_condition": "cscart_categories.parent_id = 0 and cscart_categories.category_id <> 1",
              "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` = 'A' and cscart_categories.storefront_id in (0,1)"
            }
          },
          {
            "table": {
              "table_name": "cscart_category_descriptions",
              "access_type": "eq_ref",
              "possible_keys": ["PRIMARY"],
              "key": "PRIMARY",
              "key_length": "9",
              "used_key_parts": ["category_id", "lang_code"],
              "ref": [
                "u428615623_ecartifygonje.cscart_categories.category_id",
                "const"
              ],
              "loops": 21,
              "rows": 1,
              "cost": 0.02124084,
              "filtered": 100,
              "attached_condition": "trigcond(cscart_category_descriptions.lang_code = 'en')"
            }
          },
          {
            "table": {
              "table_name": "cscart_seo_names",
              "access_type": "ref",
              "possible_keys": ["PRIMARY", "dispatch"],
              "key": "PRIMARY",
              "key_length": "206",
              "used_key_parts": ["object_id", "type", "dispatch", "lang_code"],
              "ref": [
                "u428615623_ecartifygonje.cscart_categories.category_id",
                "const",
                "const",
                "const"
              ],
              "loops": 21,
              "rows": 1,
              "cost": 0.02353277,
              "filtered": 100,
              "attached_condition": "trigcond(cscart_seo_names.`type` = 'c' and cscart_seo_names.dispatch = '' and cscart_seo_names.lang_code = 'en')"
            }
          },
          {
            "table": {
              "table_name": "<subquery2>",
              "access_type": "eq_ref",
              "possible_keys": ["distinct_key"],
              "key": "distinct_key",
              "key_length": "3",
              "used_key_parts": ["category_id"],
              "ref": ["func"],
              "rows": 1,
              "filtered": 100,
              "materialized": {
                "unique": 1,
                "query_block": {
                  "select_id": 2,
                  "nested_loop": [
                    {
                      "table": {
                        "table_name": "pd",
                        "access_type": "range",
                        "possible_keys": ["PRIMARY", "status"],
                        "key": "status",
                        "key_length": "3",
                        "used_key_parts": ["status"],
                        "loops": 1,
                        "rows": 253,
                        "cost": 0.0940132,
                        "filtered": 100,
                        "index_condition": "pd.`status` = 'A'",
                        "attached_condition": "pd.company_id = 36"
                      }
                    },
                    {
                      "table": {
                        "table_name": "pc",
                        "access_type": "ref",
                        "possible_keys": ["PRIMARY", "pt"],
                        "key": "pt",
                        "key_length": "3",
                        "used_key_parts": ["product_id"],
                        "ref": ["u428615623_ecartifygonje.pd.product_id"],
                        "loops": 253,
                        "rows": 1,
                        "cost": 0.247090665,
                        "filtered": 93.489151,
                        "using_index": true
                      }
                    }
                  ]
                }
              }
            }
          }
        ]
      }
    }
  }
}

Result

category_id parent_id id_path category position status company_id storefront_id seo_name seo_path age_verification age_limit age_warning_message
20 0 20 Supplier 1 A 0 0 suppliers-en N 0