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 = 264 
WHERE 
  cscart_products_categories.product_id IN (
    195, 199, 198, 94, 96, 201, 192, 136, 191, 
    90, 196, 252, 95, 197, 251, 200, 84, 85, 
    88, 47, 253, 138, 93, 87, 139, 83, 204, 
    256, 137, 248, 108, 97, 121, 286, 103, 
    89, 110, 82, 100, 194, 202, 203, 111, 
    104, 123, 118, 119, 112, 114, 116
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.00137

JSON explain

{
  "query_block": {
    "select_id": 1,
    "nested_loop": [
      {
        "read_sorted_file": {
          "filesort": {
            "sort_key": "cscart_products_categories.product_id",
            "table": {
              "table_name": "cscart_products_categories",
              "access_type": "ALL",
              "possible_keys": ["PRIMARY", "pt"],
              "rows": 281,
              "filtered": 19.21708107,
              "attached_condition": "cscart_products_categories.product_id in (195,199,198,94,96,201,192,136,191,90,196,252,95,197,251,200,84,85,88,47,253,138,93,87,139,83,204,256,137,248,108,97,121,286,103,89,110,82,100,194,202,203,111,104,123,118,119,112,114,116)"
            }
          }
        }
      },
      {
        "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": ["cscart.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", "cscart.cscart_products_categories.product_id"],
          "rows": 1,
          "filtered": 100
        }
      }
    ]
  }
}

Result

product_id category_ids position
47 247M
82 246M
83 246M
84 246M
85 246M
87 246M
88 247M
89 247M
90 247M
93 248M
94 248M
95 248M
96 248M
97 242M
100 242M
103 242M
104 242M
108 242M
110 243M
111 243M
112 243M
114 243M
116 243M
118 244M
119 244M
121 244M
123 244M
136 249M
137 249M
138 249M
139 249M
191 231M
192 232M
194 232M
195 232M
196 232M
197 229M,231
198 229M
199 229M
200 230M
201 230M
202 230M
203 230M
204 232M
248 263M,255,248M
251 259M
252 259M
253 259M
256 261M
286 242M