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 = 7148 
WHERE 
  cscart_products_categories.product_id IN (
    91052, 87652, 87658, 87666, 87672, 87673, 
    87679, 87680, 87686, 87701, 87707, 
    87709, 87721, 87723, 87735, 88694, 
    88695, 88741, 88742, 84697, 84698, 
    88946, 88947, 88948, 82404, 88140, 
    88143, 88508, 87252, 87253, 87254, 
    87255, 87256, 87257, 87258, 87259, 
    88102, 88103, 92203, 92449, 82551, 
    82342, 87890, 82367, 88943, 88944, 
    88945, 92168
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.00156

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "53.07"
    },
    "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": 93,
            "rows_produced_per_join": 93,
            "filtered": "100.00",
            "using_index": true,
            "cost_info": {
              "read_cost": "9.59",
              "eval_cost": "9.30",
              "prefix_cost": "18.89",
              "data_read_per_join": "1K"
            },
            "used_columns": [
              "product_id",
              "category_id",
              "link_type"
            ],
            "attached_condition": "(`nuie_scalesta_net`.`cscart_products_categories`.`product_id` in (91052,87652,87658,87666,87672,87673,87679,87680,87686,87701,87707,87709,87721,87723,87735,88694,88695,88741,88742,84697,84698,88946,88947,88948,82404,88140,88143,88508,87252,87253,87254,87255,87256,87257,87258,87259,88102,88103,92203,92449,82551,82342,87890,82367,88943,88944,88945,92168))"
          }
        },
        {
          "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": 4,
            "filtered": "5.00",
            "cost_info": {
              "read_cost": "23.25",
              "eval_cost": "0.47",
              "prefix_cost": "51.44",
              "data_read_per_join": "12K"
            },
            "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": 4,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "1.16",
              "eval_cost": "0.47",
              "prefix_cost": "53.07",
              "data_read_per_join": "74"
            },
            "used_columns": [
              "product_id",
              "category_id",
              "position"
            ]
          }
        }
      ]
    }
  }
}

Result

product_id category_ids position
82342 7301,7151M
82367 7301,7151M
82404 7301,7151M
82551 7226,7225M
84697 7241,7309,7346,7208M
84698 7241,7309,7346,7208M
87252 7263M
87253 7263M
87254 7263M
87255 7263M
87256 7263M
87257 7263M
87258 7263M
87259 7263M
87652 7194M
87658 7194M
87666 7194M
87672 7194M
87673 7194M
87679 7194M
87680 7194M
87686 7194M
87701 7194M
87707 7194M
87709 7194M
87721 7194M
87723 7194M
87735 7194M
87890 7241,7309,7346,7208M
88102 7263M
88103 7263M
88140 7241,7309,7346,7208M
88143 7241,7309,7346,7208M
88508 7241,7309,7346,7208M
88694 7194M
88695 7194M
88741 7194M
88742 7194M
88943 7148,7207,7208M 0
88944 7148,7207,7208M 0
88945 7148,7207,7208M 0
88946 7148,7207,7208M 0
88947 7148,7207,7208M 0
88948 7148,7207,7208M 0
91052 7241,7309,7346,7208M
92168 7156,7157,7148M 0
92203 7341,7342,7343,7157M
92449 7341,7342,7343,7157M