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 (
    105201, 105200, 105199, 105198, 105197, 
    103834, 103833, 103832, 103831, 103830, 
    103829, 103828, 103827, 103826, 103825, 
    103824, 103823, 103822, 103821, 103820
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.00044

Explain
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE cscart_products_categories range PRIMARY,pt pt 3 20 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
103820 4M
103821 4M
103822 4M
103823 4M
103824 4M
103825 4M
103826 4M
103827 4M
103828 4M
103829 4M
103830 4M
103831 4M
103832 4M
103833 4M
103834 4M
105197 4M
105198 4M
105199 4M
105200 4M
105201 4M