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 = 7210 
WHERE 
  cscart_products_categories.product_id IN (
    88015, 87972, 88091, 88055, 88085, 88703, 
    88750, 87809, 87811, 87814, 87817, 
    87824, 90327, 88071, 88076, 88090, 
    87944, 88595, 88072, 88154, 87808, 
    87810, 87813, 87816, 87823, 87874, 
    87779, 87783, 87793, 87799, 87880, 
    87873, 90317, 90319, 90320, 88087, 
    88797, 87960, 87778, 87782, 87791, 
    87797, 87760, 88701, 88748, 88596, 
    88030, 88086
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.00116

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "72.95"
    },
    "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": 128,
            "rows_produced_per_join": 128,
            "filtered": "100.00",
            "using_index": true,
            "cost_info": {
              "read_cost": "13.11",
              "eval_cost": "12.80",
              "prefix_cost": "25.91",
              "data_read_per_join": "2K"
            },
            "used_columns": [
              "product_id",
              "category_id",
              "link_type"
            ],
            "attached_condition": "(`nuie_scalesta_net`.`cscart_products_categories`.`product_id` in (88015,87972,88091,88055,88085,88703,88750,87809,87811,87814,87817,87824,90327,88071,88076,88090,87944,88595,88072,88154,87808,87810,87813,87816,87823,87874,87779,87783,87793,87799,87880,87873,90317,90319,90320,88087,88797,87960,87778,87782,87791,87797,87760,88701,88748,88596,88030,88086))"
          }
        },
        {
          "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": 6,
            "filtered": "5.00",
            "cost_info": {
              "read_cost": "32.00",
              "eval_cost": "0.64",
              "prefix_cost": "70.71",
              "data_read_per_join": "16K"
            },
            "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": 6,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "1.60",
              "eval_cost": "0.64",
              "prefix_cost": "72.95",
              "data_read_per_join": "102"
            },
            "used_columns": [
              "product_id",
              "category_id",
              "position"
            ]
          }
        }
      ]
    }
  }
}

Result

product_id category_ids position
87760 7210,7307,7308M 0
87778 7210,7307,7308M 0
87779 7210,7307,7308M 0
87782 7210,7211,7321M 0
87783 7210,7211,7321M 0
87791 7210,7307,7308M 0
87793 7210,7307,7308M 0
87797 7210,7307,7308M 0
87799 7210,7307,7308M 0
87808 7210,7307,7308M 0
87809 7210,7307,7308M 0
87810 7210,7307,7308M 0
87811 7210,7307,7308M 0
87813 7210,7307,7308M 0
87814 7210,7307,7308M 0
87816 7210,7307,7308M 0
87817 7210,7307,7308M 0
87823 7210,7307,7308M 0
87824 7210,7307,7308M 0
87873 7241,7309,7346,7208M
87874 7241,7309,7346,7208M
87880 7241,7309,7346,7208M
87944 7320,7260M
87960 7349,7261M
87972 7320,7260M
88015 7320,7260M
88030 7349,7261M
88055 7349,7261M
88071 7349,7261M
88072 7349,7261M
88076 7349,7261M
88085 7349,7261M
88086 7262,7256M
88087 7262,7256M
88090 7262,7256M
88091 7262,7256M
88154 7320,7260M
88595 7210,7211,7282M 0
88596 7210,7211,7282M 0
88701 7210,7211,7282M 0
88703 7210,7211,7282M 0
88748 7210,7211,7282M 0
88750 7210,7211,7282M 0
88797 7210,7211,7282M 0
90317 7265,7247M
90319 7265,7247M
90320 7265,7247M
90327 7265,7247M