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, 
  product_position_source.position AS position 
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') 
  LEFT JOIN cscart_products_categories AS product_position_source ON cscart_products_categories.product_id = product_position_source.product_id 
  AND product_position_source.category_id = 22 
WHERE 
  cscart_products_categories.product_id IN (
    96636, 96635, 96634, 96633, 96632, 96631, 
    96630, 96629, 96628, 96627, 96626, 
    95927, 95925, 95924, 95919, 95918, 
    95917, 95916, 95915, 95914, 95913, 
    95912, 95911, 95910, 95909, 95908, 
    95907, 95906, 95905, 95904, 95903, 
    95902, 95901, 95900, 95899, 96116, 
    96115, 95890, 95889, 95888
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.00080

Explain
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE cscart_products_categories range PRIMARY,pt pt 3 63 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
1 SIMPLE product_position_source eq_ref PRIMARY,pt PRIMARY 6 const,toolboxdigitalshop_dev.cscart_products_categories.product_id 1

Result

product_id category_ids position
95888 22M 0
95889 22M 0
95890 22M 0
95899 32,22M 0
95900 32,22M 0
95901 32,22M 0
95902 32,22M 0
95903 32,22M 0
95904 32,22M 0
95905 32,22M 0
95906 32,22M 0
95907 32,22M 0
95908 32,22M 0
95909 32,22M 0
95910 32,22M 0
95911 32,22M 0
95912 32,22M 0
95913 32,22M 0
95914 32,22M 0
95915 32,22M 0
95916 32,22M 0
95917 32,22M 0
95918 32,22M 0
95919 32,22M 0
95924 22M 0
95925 22M 0
95927 22M 0
96115 33,22M 0
96116 33,22M 0
96626 22M 0
96627 22M 0
96628 22M 0
96629 22M 0
96630 22M 0
96631 22M 0
96632 22M 0
96633 22M 0
96634 22M 0
96635 22M 0
96636 22M 0