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 = 266 
WHERE 
  cscart_products_categories.product_id IN (
    430995, 431290, 431004, 431087, 430983, 
    431071, 431231, 431405, 431497, 431381, 
    431411, 431017, 431182, 431274, 431434, 
    430686, 430974, 431045, 431175, 430765, 
    430785, 431001, 431494, 431495, 430762, 
    430965, 431403, 431465, 381710, 430963, 
    431002, 431025, 431240, 431329, 381707, 
    430755, 430964, 430966, 431457, 430630, 
    430752, 430773, 431304, 431284, 431425, 
    431328, 430711, 430961, 431235, 431343, 
    431362, 431422, 431498, 431505, 431079, 
    431355, 431394, 431408, 431243, 431260, 
    431383, 431407, 430759, 431015, 431283, 
    431488, 430669, 430700, 430943, 430971, 
    431105, 431152, 431340, 431352, 431409, 
    430944, 431018, 431057, 431069, 431217, 
    431337, 430705, 430929, 430978, 431030, 
    431419, 430717, 430781, 431311, 431346, 
    431427, 435510, 430938, 430956, 431302, 
    431482, 431500, 431415, 431453, 430732
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.00343

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "283.96"
    },
    "grouping_operation": {
      "using_filesort": false,
      "nested_loop": [
        {
          "table": {
            "table_name": "cscart_products_categories",
            "access_type": "range",
            "possible_keys": [
              "PRIMARY",
              "link_type",
              "pt"
            ],
            "key": "pt",
            "used_key_parts": [
              "product_id"
            ],
            "key_length": "3",
            "rows_examined_per_scan": 101,
            "rows_produced_per_join": 101,
            "filtered": "100.00",
            "using_index": true,
            "cost_info": {
              "read_cost": "21.36",
              "eval_cost": "20.20",
              "prefix_cost": "41.56",
              "data_read_per_join": "1K"
            },
            "used_columns": [
              "product_id",
              "category_id",
              "link_type"
            ],
            "attached_condition": "(`webmarco`.`cscart_products_categories`.`product_id` in (430995,431290,431004,431087,430983,431071,431231,431405,431497,431381,431411,431017,431182,431274,431434,430686,430974,431045,431175,430765,430785,431001,431494,431495,430762,430965,431403,431465,381710,430963,431002,431025,431240,431329,381707,430755,430964,430966,431457,430630,430752,430773,431304,431284,431425,431328,430711,430961,431235,431343,431362,431422,431498,431505,431079,431355,431394,431408,431243,431260,431383,431407,430759,431015,431283,431488,430669,430700,430943,430971,431105,431152,431340,431352,431409,430944,431018,431057,431069,431217,431337,430705,430929,430978,431030,431419,430717,430781,431311,431346,431427,435510,430938,430956,431302,431482,431500,431415,431453,430732))"
          }
        },
        {
          "table": {
            "table_name": "product_position_source",
            "access_type": "eq_ref",
            "possible_keys": [
              "PRIMARY",
              "pt"
            ],
            "key": "PRIMARY",
            "used_key_parts": [
              "category_id",
              "product_id"
            ],
            "key_length": "6",
            "ref": [
              "const",
              "webmarco.cscart_products_categories.product_id"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 101,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "101.00",
              "eval_cost": "20.20",
              "prefix_cost": "162.76",
              "data_read_per_join": "1K"
            },
            "used_columns": [
              "product_id",
              "category_id",
              "position"
            ]
          }
        },
        {
          "table": {
            "table_name": "cscart_categories",
            "access_type": "eq_ref",
            "possible_keys": [
              "PRIMARY",
              "c_status",
              "p_category_id"
            ],
            "key": "PRIMARY",
            "used_key_parts": [
              "category_id"
            ],
            "key_length": "3",
            "ref": [
              "webmarco.cscart_products_categories.category_id"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 5,
            "filtered": "5.00",
            "cost_info": {
              "read_cost": "101.00",
              "eval_cost": "1.01",
              "prefix_cost": "283.96",
              "data_read_per_join": "29K"
            },
            "used_columns": [
              "category_id",
              "usergroup_ids",
              "status",
              "storefront_id"
            ],
            "attached_condition": "((`webmarco`.`cscart_categories`.`storefront_id` in (0,1)) and ((`webmarco`.`cscart_categories`.`usergroup_ids` = '') or find_in_set(0,`webmarco`.`cscart_categories`.`usergroup_ids`) or find_in_set(1,`webmarco`.`cscart_categories`.`usergroup_ids`)) and (`webmarco`.`cscart_categories`.`status` in ('A','H')))"
          }
        }
      ]
    }
  }
}

Result

product_id category_ids position
381707 2578M
381710 2578M
430630 2601M
430669 2601M
430686 2601M
430700 2601M
430705 2601M
430711 2601M
430717 2601M
430732 2601M
430752 2601M
430755 2601M
430759 2601M
430762 2601M
430765 2601M
430773 2601M
430781 2601M
430785 2601M
430929 2601M
430938 2601M
430943 2601M
430944 2601M
430956 2601M
430961 2601M
430963 2601M
430964 2601M
430965 2601M
430966 2601M
430971 2601M
430974 2601M
430978 2601M
430983 2601M
430995 2601M
431001 2601M
431002 2601M
431004 2601M
431015 2601M
431017 2601M
431018 2601M
431025 2601M
431030 2601M
431045 2601M
431057 2601M
431069 2601M
431071 2601M
431079 2601M
431087 2601M
431105 2601M
431152 2601M
431175 2601M
431182 2601M
431217 2601M
431231 2601M
431235 2601M
431240 2601M
431243 2601M
431260 2601M
431274 2601M
431283 2601M
431284 2601M
431290 2601M
431302 2601M
431304 2601M
431311 2601M
431328 2601M
431329 2601M
431337 2601M
431340 2601M
431343 2601M
431346 2601M
431352 2601M
431355 2601M
431362 2601M
431381 2601M
431383 2601M
431394 2601M
431403 2601M
431405 2601M
431407 2601M
431408 2601M
431409 2601M
431411 2601M
431415 2601M
431419 2601M
431422 2601M
431425 2601M
431427 2601M
431434 2601M
431453 2601M
431457 2601M
431465 2601M
431482 2601M
431488 2601M
431494 2601M
431495 2601M
431497 2601M
431498 2601M
431500 2601M
431505 2601M
435510 10669,10667M