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 (
    103897, 103896, 103895, 103894, 103893, 
    103892, 103891, 103890, 103889, 103888, 
    103887, 103886, 103885, 103884, 103883, 
    103882, 103881, 103880, 103879, 103878
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.00038

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
103878 4M
103879 4M
103880 4M
103881 4M
103882 4M
103883 4M
103884 4M
103885 4M
103886 4M
103887 4M
103888 4M
103889 4M
103890 4M
103891 4M
103892 4M
103893 4M
103894 4M
103895 4M
103896 4M
103897 18,13M