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 (
    105210, 105209, 105250, 105249, 105248, 
    105247, 105246, 105245, 105244, 105243, 
    105242, 105241, 105240, 105208, 105207, 
    105206, 105205, 105204, 105203, 105202
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.00031

Explain
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE cscart_products_categories range PRIMARY,pt pt 3 22 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
105202 4M
105203 4M
105204 4M
105205 4M
105206 4M
105207 4M
105208 18,13M
105209 4M
105210 4M
105240 4M
105241 4M
105242 4M
105243 4M
105244 4M
105245 4M
105246 4M
105247 4M
105248 4M
105249 4M
105250 18,13M