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 = 9 
WHERE 
  cscart_products_categories.product_id IN (
    728, 96, 141, 95, 149, 148, 150, 133, 132, 
    131, 94, 385, 138, 137, 139, 127, 128, 
    130, 101, 146, 124, 125, 622, 481, 760, 
    346, 371, 353, 494, 522, 479, 458, 442, 
    432, 441, 439, 480, 440, 364, 338, 383, 
    419, 352, 682, 81, 50, 306, 817
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.00202

JSON explain

{
  "query_block": {
    "select_id": 1,
    "table": {
      "table_name": "cscart_products_categories",
      "access_type": "range",
      "possible_keys": ["PRIMARY", "pt"],
      "key": "pt",
      "key_length": "3",
      "used_key_parts": ["product_id"],
      "rows": 49,
      "filtered": 100,
      "index_condition": "cscart_products_categories.product_id in (728,96,141,95,149,148,150,133,132,131,94,385,138,137,139,127,128,130,101,146,124,125,622,481,760,346,371,353,494,522,479,458,442,432,441,439,480,440,364,338,383,419,352,682,81,50,306,817)"
    },
    "table": {
      "table_name": "cscart_categories",
      "access_type": "eq_ref",
      "possible_keys": ["PRIMARY", "c_status", "p_category_id"],
      "key": "PRIMARY",
      "key_length": "3",
      "used_key_parts": ["category_id"],
      "ref": ["bacpvdev_db.cscart_products_categories.category_id"],
      "rows": 1,
      "filtered": 100,
      "attached_condition": "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')"
    },
    "table": {
      "table_name": "product_position_source",
      "access_type": "eq_ref",
      "possible_keys": ["PRIMARY", "pt"],
      "key": "PRIMARY",
      "key_length": "6",
      "used_key_parts": ["category_id", "product_id"],
      "ref": ["const", "bacpvdev_db.cscart_products_categories.product_id"],
      "rows": 1,
      "filtered": 100
    }
  }
}

Result

product_id category_ids position
50 9M 0
81 9M 0
94 9M 0
95 9M 0
96 9M 0
101 9M 0
124 9M 0
125 9M 0
127 9M 0
128 9M 0
130 9M 0
131 9M 0
132 9M 0
133 9M 0
137 9M 0
138 9M 0
139 9M 0
141 9M 0
146 9M 0
148 9M 0
149 9M 0
150 9M 0
306 9M 0
338 9M 0
346 9M 0
352 9M 0
353 9M 0
364 9M 0
371 9M 0
383 9M 0
385 9M 0
419 9M 0
432 9M 0
439 9M 0
440 9M 0
441 9M 0
442 9M 0
458 9M 0
479 9M 0
480 9M 0
481 9M 0
494 9M 0
522 9M 0
622 9M 0
682 9M 0
728 9M 0
760 9M 0
817 9M 0