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 (
    103719, 103718, 103806, 103805, 103804, 
    103803, 103802, 103801, 103800, 103799, 
    103798, 103797, 103796, 103795, 103794, 
    103793, 103792, 103773, 103772, 103771
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.00036

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
103718 4M
103719 4M
103771 4M
103772 4M
103773 18,13M
103792 4M
103793 4M
103794 4M
103795 4M
103796 4M
103797 4M
103798 4M
103799 4M
103800 4M
103801 4M
103802 4M
103803 4M
103804 4M
103805 4M
103806 18,13M