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 (
    48374, 48373, 48372, 48371, 48370, 48369, 
    48368, 48367, 48366, 48365, 48364, 
    48363, 48362, 48361, 48360, 48359, 
    48358, 48357, 48356, 48355, 48354, 
    48353, 48352, 48351, 70736, 70735, 
    70734, 70733, 48051, 48033, 48032, 
    48031, 47866, 48025, 47884, 47883, 
    47851, 47885, 48028, 47854, 47850, 
    47849, 47813, 47723, 90955, 90954, 
    90953, 90952, 90951, 90950, 90949, 
    47810, 48013, 47836, 47815, 47814, 
    47808, 47689, 47818, 47778, 47777, 
    47776, 47775, 47763, 47762, 47761, 
    47760, 47639, 47744, 47743, 47742, 
    47746, 47604, 47603, 47602, 47601, 
    47600, 47599, 47598, 47597
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.00160

Explain
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE cscart_products_categories range PRIMARY,pt pt 3 91 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
47597 22M 0
47598 22M 0
47599 22M 0
47600 22M 0
47601 22M 0
47602 22M 0
47603 22M 0
47604 22M 0
47639 22M 0
47689 22M 0
47723 22M 0
47742 33,22M 0
47743 33,22M 0
47744 33,22M 0
47746 22M 0
47760 22M 0
47761 22M 0
47762 22M 0
47763 22M 0
47775 22M 0
47776 22M 0
47777 22M 0
47778 22M 0
47808 22M 0
47810 22M 0
47813 22M 0
47814 22M 0
47815 22M 0
47818 22M 0
47836 22M 0
47849 32,22M 0
47850 32,22M 0
47851 22M 0
47854 22M 0
47866 22M 0
47883 22M 0
47884 22M 0
47885 22M 0
48013 22M 0
48025 22M 0
48028 22M 0
48031 22M 0
48032 22M 0
48033 22M 0
48051 22M 0
48351 22M 0
48352 22M 0
48353 22M 0
48354 22M 0
48355 22M 0
48356 22M 0
48357 22M 0
48358 22M 0
48359 22M 0
48360 22M 0
48361 22M 0
48362 22M 0
48363 22M 0
48364 22M 0
48365 22M 0
48366 22M 0
48367 22M 0
48368 22M 0
48369 22M 0
48370 22M 0
48371 22M 0
48372 22M 0
48373 22M 0
48374 22M 0
70733 22M 0
70734 22M 0
70735 22M 0
70736 22M 0
90949 33,22M 0
90950 22M 0
90951 33,22M 0
90952 33,22M 0
90953 33,22M 0
90954 33,22M 0
90955 33,22M 0