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 (
    105381, 105380, 105379, 105378, 105377, 
    105376, 105375, 105309, 105308, 105307, 
    105306, 105305, 105304, 105303, 105302, 
    105301, 105300, 105299, 105298, 105297
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.00028

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
105297 18,13M
105298 1M
105299 1M
105300 1M
105301 1M
105302 1M
105303 1M
105304 1M
105305 1M
105306 1M
105307 1M
105308 1M
105309 18,13M
105375 4M
105376 4M
105377 4M
105378 4M
105379 4M
105380 4M
105381 4M