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 = 7257 
WHERE 
  cscart_products_categories.product_id IN (
    88088, 87875, 87937, 90323, 87950, 87959, 
    90826, 87952, 88004, 88056, 88057, 
    88058, 87998, 88000, 88037, 90329, 
    90330, 90331, 90333, 90334, 90337, 
    90338, 90339, 90340, 90341, 90342, 
    90345, 90346, 90347, 90348, 87881, 
    88031, 87948, 88059, 88060, 89985, 
    87945, 89986, 88041, 87940, 87942, 
    87964, 90328, 90332, 90335, 90336, 
    90343, 90344, 88029, 88018, 88021, 
    88006, 88013, 88015, 87972, 88091, 
    88055, 88085, 90327, 88071, 88076, 
    88090, 87944, 88072, 88154, 87874, 
    87880, 87873, 90317, 90319, 90320, 
    88087, 87960, 88030, 88086, 88019, 
    87992, 88001, 88005, 87939, 87989, 
    87943, 87973, 87999, 90808, 87965, 
    88014, 88020, 92893, 92894, 93002, 
    93003, 93004, 93005, 93006, 93007
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.00303

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "128.60"
    },
    "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": 226,
            "rows_produced_per_join": 226,
            "filtered": "100.00",
            "using_index": true,
            "cost_info": {
              "read_cost": "22.94",
              "eval_cost": "22.60",
              "prefix_cost": "45.54",
              "data_read_per_join": "3K"
            },
            "used_columns": [
              "product_id",
              "category_id",
              "link_type"
            ],
            "attached_condition": "(`nuie_scalesta_net`.`cscart_products_categories`.`product_id` in (88088,87875,87937,90323,87950,87959,90826,87952,88004,88056,88057,88058,87998,88000,88037,90329,90330,90331,90333,90334,90337,90338,90339,90340,90341,90342,90345,90346,90347,90348,87881,88031,87948,88059,88060,89985,87945,89986,88041,87940,87942,87964,90328,90332,90335,90336,90343,90344,88029,88018,88021,88006,88013,88015,87972,88091,88055,88085,90327,88071,88076,88090,87944,88072,88154,87874,87880,87873,90317,90319,90320,88087,87960,88030,88086,88019,87992,88001,88005,87939,87989,87943,87973,87999,90808,87965,88014,88020,92893,92894,93002,93003,93004,93005,93006,93007))"
          }
        },
        {
          "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": [
              "nuie_scalesta_net.cscart_products_categories.category_id"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 11,
            "filtered": "5.00",
            "cost_info": {
              "read_cost": "56.50",
              "eval_cost": "1.13",
              "prefix_cost": "124.64",
              "data_read_per_join": "29K"
            },
            "used_columns": [
              "category_id",
              "usergroup_ids",
              "status",
              "storefront_id"
            ],
            "attached_condition": "((`nuie_scalesta_net`.`cscart_categories`.`storefront_id` in (0,1)) and ((`nuie_scalesta_net`.`cscart_categories`.`usergroup_ids` = '') or (0 <> find_in_set(0,`nuie_scalesta_net`.`cscart_categories`.`usergroup_ids`)) or (0 <> find_in_set(1,`nuie_scalesta_net`.`cscart_categories`.`usergroup_ids`))) and (`nuie_scalesta_net`.`cscart_categories`.`status` in ('A','H')))"
          }
        },
        {
          "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",
              "nuie_scalesta_net.cscart_products_categories.product_id"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 11,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "2.83",
              "eval_cost": "1.13",
              "prefix_cost": "128.60",
              "data_read_per_join": "180"
            },
            "used_columns": [
              "product_id",
              "category_id",
              "position"
            ]
          }
        }
      ]
    }
  }
}

Result

product_id category_ids position
87873 7241,7309,7346,7208M
87874 7241,7309,7346,7208M
87875 7241,7309,7346,7208M
87880 7241,7309,7346,7208M
87881 7241,7309,7346,7208M
87937 7345,7347,7259M
87939 7349,7261M
87940 7262,7256M
87942 7320,7260M
87943 7349,7261M
87944 7320,7260M
87945 7320,7260M
87948 7345,7347,7259M
87950 7345,7347,7259M
87952 7345,7347,7259M
87959 7320,7260M
87960 7349,7261M
87964 7320,7260M
87965 7349,7261M
87972 7320,7260M
87973 7349,7261M
87989 7349,7261M
87992 7349,7261M
87998 7320,7260M
87999 7349,7261M
88000 7320,7260M
88001 7349,7261M
88004 7345,7347,7259M
88005 7349,7261M
88006 7320,7260M
88013 7320,7260M
88014 7349,7261M
88015 7320,7260M
88018 7320,7260M
88019 7349,7261M
88020 7349,7261M
88021 7320,7260M
88029 7345,7347,7259M
88030 7349,7261M
88031 7320,7260M
88037 7262,7256M
88041 7349,7261M
88055 7349,7261M
88056 7262,7256M
88057 7262,7256M
88058 7262,7256M
88059 7262,7256M
88060 7262,7256M
88071 7349,7261M
88072 7349,7261M
88076 7349,7261M
88085 7349,7261M
88086 7262,7256M
88087 7262,7256M
88088 7262,7256M
88090 7262,7256M
88091 7262,7256M
88154 7320,7260M
89985 7349,7261M
89986 7349,7261M
90317 7265,7247M
90319 7265,7247M
90320 7265,7247M
90323 7265,7247M
90327 7265,7247M
90328 7265,7247M
90329 7265,7247M
90330 7265,7247M
90331 7265,7247M
90332 7265,7247M
90333 7265,7247M
90334 7265,7247M
90335 7265,7247M
90336 7265,7247M
90337 7265,7247M
90338 7265,7247M
90339 7265,7247M
90340 7265,7247M
90341 7265,7247M
90342 7265,7247M
90343 7265,7247M
90344 7265,7247M
90345 7265,7247M
90346 7265,7247M
90347 7265,7247M
90348 7265,7247M
90808 7349,7261M
90826 7241,7309,7346,7208M
92893 7241,7309,7346,7208M
92894 7241,7309,7346,7208M
93002 7241,7309,7346,7208M
93003 7241,7309,7346,7208M
93004 7241,7309,7346,7208M
93005 7241,7309,7346,7208M
93006 7241,7309,7346,7208M
93007 7241,7309,7346,7208M