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 (
    88464, 88480, 88691, 88738, 87548, 88077, 
    88141, 88144, 88767, 90829, 89574, 
    88939, 89017, 88547, 87986, 87946, 
    88583, 88674, 88721, 87947, 87949, 
    88043, 88582, 90833, 87956, 89982, 
    89983, 89984, 88081, 87620, 87622, 
    84702, 84705, 91052, 88003, 88545, 
    88046, 88080, 88403, 84697, 84698, 
    88028, 88140, 88143, 88508, 88543, 
    88765, 89016
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.00186

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "75.78"
    },
    "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": 133,
            "rows_produced_per_join": 133,
            "filtered": "100.00",
            "using_index": true,
            "cost_info": {
              "read_cost": "13.61",
              "eval_cost": "13.30",
              "prefix_cost": "26.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 (88464,88480,88691,88738,87548,88077,88141,88144,88767,90829,89574,88939,89017,88547,87986,87946,88583,88674,88721,87947,87949,88043,88582,90833,87956,89982,89983,89984,88081,87620,87622,84702,84705,91052,88003,88545,88046,88080,88403,84697,84698,88028,88140,88143,88508,88543,88765,89016))"
          }
        },
        {
          "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": "33.25",
              "eval_cost": "0.67",
              "prefix_cost": "73.46",
              "data_read_per_join": "17K"
            },
            "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.66",
              "eval_cost": "0.67",
              "prefix_cost": "75.79",
              "data_read_per_join": "106"
            },
            "used_columns": [
              "product_id",
              "category_id",
              "position"
            ]
          }
        }
      ]
    }
  }
}

Result

product_id category_ids position
84697 7241,7309,7346,7208M
84698 7241,7309,7346,7208M
84702 7241,7309,7346,7208M
84705 7241,7309,7346,7208M
87548 7210,7211,7214M 0
87620 7210,7211,7212M 0
87622 7210,7211,7212M 0
87946 7258M
87947 7258M
87949 7258M
87956 7258M
87986 7258M
88003 7258M
88028 7258M
88043 7258M
88046 7345,7347,7259M
88077 7258M
88080 7258M
88081 7258M
88140 7241,7309,7346,7208M
88141 7241,7309,7346,7208M
88143 7241,7309,7346,7208M
88144 7241,7309,7346,7208M
88403 7210,7211,7214M 0
88464 7210,7211,7214M 0
88480 7210,7211,7214M 0
88508 7241,7309,7346,7208M
88543 7210,7211,7212M 0
88545 7210,7211,7214M 0
88547 7210,7211,7212M 0
88582 7210,7211,7214M 0
88583 7210,7211,7214M 0
88674 7210,7211,7214M 0
88691 7210,7211,7214M 0
88721 7210,7211,7214M 0
88738 7210,7211,7214M 0
88765 7210,7211,7214M 0
88767 7210,7211,7214M 0
88939 7241,7309,7346,7208M
89016 7210,7211,7212M 0
89017 7210,7211,7212M 0
89574 7210,7240,7241M 0
89982 7345,7347,7259M
89983 7345,7347,7259M
89984 7345,7347,7259M
90829 7210,7211,7212M 0
90833 7210,7211,7214M 0
91052 7241,7309,7346,7208M