SELECT 
  id_path 
FROM 
  cscart_categories c 
  JOIN cscart_category_vendor_product_count p USING(category_id) 
WHERE 
  p.company_id = 5

Query time 0.00041

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost": 0.02093239,
    "nested_loop": [
      {
        "table": {
          "table_name": "p",
          "access_type": "ref",
          "possible_keys": ["PRIMARY"],
          "key": "PRIMARY",
          "key_length": "4",
          "used_key_parts": ["company_id"],
          "ref": ["const"],
          "loops": 1,
          "rows": 17,
          "cost": 0.00490771,
          "filtered": 100
        }
      },
      {
        "table": {
          "table_name": "c",
          "access_type": "eq_ref",
          "possible_keys": ["PRIMARY", "p_category_id"],
          "key": "PRIMARY",
          "key_length": "3",
          "used_key_parts": ["category_id"],
          "ref": ["u985510652_ecartify.p.category_id"],
          "loops": 17,
          "rows": 1,
          "cost": 0.01602468,
          "filtered": 100
        }
      }
    ]
  }
}

Result

id_path
167/169
203/211/214
223
287/288/289
287/304/305
460/475
219/495
219/498
203/500