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 = 7211 
WHERE 
  cscart_products_categories.product_id IN (
    88768, 88940, 88449, 88466, 88482, 88690, 
    88737, 84703, 84706, 88082, 91053, 
    87616, 87624, 90815, 88941, 89102, 
    89108, 89110, 89115, 87958, 88068, 
    88675, 88722, 88067, 88512, 88548, 
    88590, 88591, 88592, 90834, 88447, 
    88464, 88480, 88691, 88738, 87548, 
    88141, 88144, 88767, 90829, 88939, 
    89017, 88547, 88583, 88674, 88721, 
    88582, 90833, 89982, 89983, 89984, 
    87620, 87622, 84702, 84705, 91052, 
    88545, 88046, 88403, 84697, 84698, 
    88140, 88143, 88508, 88543, 88765, 
    89016, 88566, 87617, 87625, 87890, 
    88673, 88720, 88401, 84695, 88937, 
    87877, 88045, 88565, 88564, 87636, 
    88515, 88518, 89107, 89114, 88514, 
    88517, 90832, 88511, 87621, 87623, 
    88083, 88671, 88718, 87635, 87638
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.01729

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "138.07"
    },
    "grouping_operation": {
      "using_temporary_table": true,
      "using_filesort": true,
      "cost_info": {
        "sort_cost": "12.09"
      },
      "nested_loop": [
        {
          "table": {
            "table_name": "cscart_categories",
            "access_type": "ALL",
            "possible_keys": [
              "PRIMARY",
              "c_status",
              "p_category_id"
            ],
            "rows_examined_per_scan": 208,
            "rows_produced_per_join": 8,
            "filtered": "4.00",
            "cost_info": {
              "read_cost": "20.72",
              "eval_cost": "0.83",
              "prefix_cost": "21.55",
              "data_read_per_join": "21K"
            },
            "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": "cscart_products_categories",
            "access_type": "ref",
            "possible_keys": [
              "PRIMARY",
              "link_type",
              "pt"
            ],
            "key": "PRIMARY",
            "used_key_parts": [
              "category_id"
            ],
            "key_length": "3",
            "ref": [
              "nuie_scalesta_net.cscart_categories.category_id"
            ],
            "rows_examined_per_scan": 117,
            "rows_produced_per_join": 12,
            "filtered": "1.24",
            "cost_info": {
              "read_cost": "2.33",
              "eval_cost": "1.21",
              "prefix_cost": "121.75",
              "data_read_per_join": "193"
            },
            "used_columns": [
              "product_id",
              "category_id",
              "link_type"
            ],
            "attached_condition": "(`nuie_scalesta_net`.`cscart_products_categories`.`product_id` in (88768,88940,88449,88466,88482,88690,88737,84703,84706,88082,91053,87616,87624,90815,88941,89102,89108,89110,89115,87958,88068,88675,88722,88067,88512,88548,88590,88591,88592,90834,88447,88464,88480,88691,88738,87548,88141,88144,88767,90829,88939,89017,88547,88583,88674,88721,88582,90833,89982,89983,89984,87620,87622,84702,84705,91052,88545,88046,88403,84697,84698,88140,88143,88508,88543,88765,89016,88566,87617,87625,87890,88673,88720,88401,84695,88937,87877,88045,88565,88564,87636,88515,88518,89107,89114,88514,88517,90832,88511,87621,87623,88083,88671,88718,87635,87638))"
          }
        },
        {
          "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": 12,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "3.02",
              "eval_cost": "1.21",
              "prefix_cost": "125.98",
              "data_read_per_join": "193"
            },
            "used_columns": [
              "product_id",
              "category_id",
              "position"
            ]
          }
        }
      ]
    }
  }
}

Result

product_id category_ids position
84695 7208M,7241,7309,7346
84697 7208M,7241,7309,7346
84698 7208M,7241,7309,7346
84702 7208M,7241,7309,7346
84703 7208M,7241,7309,7346
84705 7208M,7241,7309,7346
84706 7208M,7241,7309,7346
87548 7210,7211,7214M 0
87616 7210,7211,7212M 0
87617 7210,7211,7214M 0
87620 7210,7211,7212M 0
87621 7210,7211,7214M 0
87622 7210,7211,7212M 0
87623 7210,7211,7214M 0
87624 7210,7211,7212M 0
87625 7210,7211,7214M 0
87635 7210,7211,7214M 0
87636 7210,7211,7214M 0
87638 7210,7211,7214M 0
87877 7208M,7241,7309,7346
87890 7208M,7241,7309,7346
87958 7259M,7345,7347
88045 7259M,7345,7347
88046 7259M,7345,7347
88067 7260M,7320
88068 7260M,7320
88082 7259M,7345,7347
88083 7260M,7320
88140 7208M,7241,7309,7346
88141 7208M,7241,7309,7346
88143 7208M,7241,7309,7346
88144 7208M,7241,7309,7346
88401 7210,7211,7214M 0
88403 7210,7211,7214M 0
88447 7210,7211,7214M 0
88449 7210,7211,7214M 0
88464 7210,7211,7214M 0
88466 7210,7211,7214M 0
88480 7210,7211,7214M 0
88482 7210,7211,7214M 0
88508 7208M,7241,7309,7346
88511 7208M,7241,7309,7346
88512 7208M,7241,7309,7346
88514 7208M,7241,7309,7346
88515 7208M,7241,7309,7346
88517 7208M,7241,7309,7346
88518 7208M,7241,7309,7346
88543 7210,7211,7212M 0
88545 7210,7211,7214M 0
88547 7210,7211,7212M 0
88548 7210,7211,7282M 0
88564 7210,7211,7214M 0
88565 7210,7211,7214M 0
88566 7210,7211,7214M 0
88582 7210,7211,7214M 0
88583 7210,7211,7214M 0
88590 7210,7211,7282M 0
88591 7210,7211,7282M 0
88592 7210,7211,7282M 0
88671 7210,7211,7214M 0
88673 7210,7211,7214M 0
88674 7210,7211,7214M 0
88675 7210,7211,7214M 0
88690 7210,7211,7214M 0
88691 7210,7211,7214M 0
88718 7210,7211,7214M 0
88720 7210,7211,7214M 0
88721 7210,7211,7214M 0
88722 7210,7211,7214M 0
88737 7210,7211,7214M 0
88738 7210,7211,7214M 0
88765 7210,7211,7214M 0
88767 7210,7211,7214M 0
88768 7210,7211,7214M 0
88937 7208M,7241,7309,7346
88939 7208M,7241,7309,7346
88940 7208M,7241,7309,7346
88941 7208M,7241,7309,7346
89016 7210,7211,7212M 0
89017 7210,7211,7212M 0
89102 7210,7211,7212M 0
89107 7210,7211,7214M 0
89108 7210,7211,7214M 0
89110 7210,7211,7212M 0
89114 7210,7211,7214M 0
89115 7210,7211,7214M 0
89982 7259M,7345,7347
89983 7259M,7345,7347
89984 7259M,7345,7347
90815 7210,7211,7212M 0
90829 7210,7211,7212M 0
90832 7210,7211,7214M 0
90833 7210,7211,7214M 0
90834 7210,7211,7214M 0
91052 7208M,7241,7309,7346
91053 7208M,7241,7309,7346