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 (
    105252, 105251, 105229, 105228, 105227, 
    105226, 105225, 105224, 105223, 105222, 
    105221, 105220, 105219, 103726, 103725, 
    103724, 103723, 103722, 103721, 103720
  ) 
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 21 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
103720 4M
103721 4M
103722 4M
103723 4M
103724 4M
103725 4M
103726 4M
105219 4M
105220 4M
105221 4M
105222 4M
105223 4M
105224 4M
105225 4M
105226 4M
105227 4M
105228 4M
105229 18,13M
105251 4M
105252 4M