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 (
    87227, 87226, 87225, 87224, 87223, 87222, 
    87221, 87220, 87219, 87218, 87217, 
    87216, 87000, 86999, 86998, 86997, 
    86996, 86995, 86994, 86993, 86506, 
    86447, 86446, 86445, 86444, 86384, 
    86383, 86382, 86381, 86380, 86379, 
    86378, 86377, 86376, 86375, 86374, 
    87116, 86470, 86469, 86468
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.00072

Explain
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE cscart_products_categories range PRIMARY,pt pt 3 48 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
86374 22M 0
86375 22M 0
86376 22M 0
86377 22M 0
86378 22M 0
86379 33,22M 0
86380 22M 0
86381 22M 0
86382 22M 0
86383 22M 0
86384 22M 0
86444 33,22M 0
86445 33,22M 0
86446 33,22M 0
86447 33,22M 0
86468 33,22M 0
86469 33,22M 0
86470 33,22M 0
86506 22M 0
86993 22M 0
86994 22M 0
86995 22M 0
86996 22M 0
86997 22M 0
86998 22M 0
86999 22M 0
87000 22M 0
87116 22M 0
87216 22M 0
87217 22M 0
87218 22M 0
87219 22M 0
87220 22M 0
87221 22M 0
87222 22M 0
87223 22M 0
87224 22M 0
87225 22M 0
87226 22M 0
87227 22M 0