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 (
    46924, 46923, 46922, 46873, 46872, 46871, 
    46870, 46869, 46868, 46867, 46866, 
    46865, 46864, 46863, 46862, 46861, 
    46860, 46859, 46858, 46857, 46624, 
    46568, 46567, 46565, 46822, 46821, 
    46820, 46819, 46901, 46900, 46899, 
    46898, 46897, 46896, 46895, 46894, 
    46893, 46892, 46891, 46890, 46889, 
    46888, 46887, 46886, 46885, 46884, 
    46883, 46882, 46881, 46880, 46879, 
    46878, 46877, 46621, 46620, 46619, 
    46618, 46617, 46616, 46615, 46614, 
    46613, 46535, 46534, 46533, 46532, 
    46519, 46477, 46472, 46471, 46437, 
    46702, 46701, 46700, 46699, 46348, 
    46329, 46580, 46579, 46358
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.00115

Explain
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE cscart_products_categories range PRIMARY,pt pt 3 83 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
46329 22M 0
46348 22M 0
46358 22M 0
46437 22M 0
46471 22M 0
46472 22M 0
46477 22M 0
46519 22M 0
46532 22M 0
46533 22M 0
46534 22M 0
46535 22M 0
46565 22M 0
46567 22M 0
46568 22M 0
46579 22M 0
46580 22M 0
46613 22M 0
46614 22M 0
46615 22M 0
46616 22M 0
46617 22M 0
46618 22M 0
46619 22M 0
46620 22M 0
46621 22M 0
46624 22M 0
46699 22M 0
46700 22M 0
46701 22M 0
46702 22M 0
46819 22M 0
46820 22M 0
46821 22M 0
46822 22M 0
46857 22M 0
46858 22M 0
46859 22M 0
46860 22M 0
46861 22M 0
46862 22M 0
46863 22M 0
46864 22M 0
46865 33,22M 0
46866 22M 0
46867 22M 0
46868 22M 0
46869 22M 0
46870 33,22M 0
46871 22M 0
46872 22M 0
46873 22M 0
46877 22M 0
46878 22M 0
46879 22M 0
46880 22M 0
46881 22M 0
46882 22M 0
46883 22M 0
46884 22M 0
46885 22M 0
46886 22M 0
46887 22M 0
46888 22M 0
46889 22M 0
46890 22M 0
46891 22M 0
46892 22M 0
46893 22M 0
46894 22M 0
46895 22M 0
46896 22M 0
46897 22M 0
46898 22M 0
46899 22M 0
46900 22M 0
46901 22M 0
46922 22M 0
46923 22M 0
46924 33,22M 0