SELECT 
  cscart_products_categories.product_id, 
  GROUP_CONCAT(
    IF(
      cscart_products_categories.link_type = "M", 
      CONCAT(
        cscart_products_categories.category_id, 
        "M"
      ), 
      cscart_products_categories.category_id
    )
  ) AS category_ids 
FROM 
  cscart_products_categories 
  INNER JOIN cscart_categories ON cscart_categories.category_id = cscart_products_categories.category_id 
  AND cscart_categories.storefront_id IN (0, 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', 'H') 
WHERE 
  cscart_products_categories.product_id IN (
    66092, 66091, 66090, 66089, 66088, 66087, 
    66086, 66085, 66084, 66083, 66082, 
    66081, 66080, 66079, 66078, 66077, 
    66076, 66075, 66074, 66073, 66072, 
    66071, 66070, 66069, 66068, 66067, 
    66066, 66065, 66064, 66063
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.00046

Explain
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE cscart_products_categories range PRIMARY,pt pt 3 30 Using where; Using index
1 SIMPLE cscart_categories eq_ref PRIMARY,c_status,p_category_id PRIMARY 3 toolboxdigitalshop_dev.cscart_products_categories.category_id 1 Using where

Result

product_id category_ids
66063 4M
66064 4M
66065 4M
66066 4M
66067 4M
66068 4M
66069 4M
66070 4M
66071 4M
66072 4M
66073 4M
66074 4M
66075 4M
66076 4M
66077 4M
66078 4M
66079 4M
66080 4M
66081 4M
66082 4M
66083 4M
66084 4M
66085 4M
66086 4M
66087 4M
66088 4M
66089 4M
66090 4M
66091 4M
66092 4M