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 = 280 
WHERE 
  cscart_products_categories.product_id IN (
    10706, 10707, 10708, 10709, 10710, 10711, 
    10712, 10713, 10714, 10715, 10716, 
    10717, 10718, 10719, 10720, 10721, 
    10722, 10723, 10724, 10725, 10726, 
    10727, 10728, 10729, 10730, 10731, 
    10732, 10733, 10734, 10735, 10736, 
    10737, 10738, 10739, 10740, 10741, 
    10742, 10743, 10744, 10745, 10746, 
    10747, 10748, 10749, 10750, 10751, 
    10752, 10753, 10754, 10755, 10756, 
    10757, 10758, 10759, 10880, 10881, 
    10882, 10883, 10884, 10885, 10886, 
    10887, 10888, 10889, 10890, 10891, 
    10892, 10893, 10894, 10895, 10896, 
    10897, 10898, 10921, 10922, 10923, 
    10924, 10925, 10926, 10927, 10928, 
    10929, 10930, 10931, 10932, 10933, 
    10934, 10935, 10936, 10937, 10938, 
    10939, 10940, 10941, 10942, 10943
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.00258

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "68.67"
    },
    "grouping_operation": {
      "using_temporary_table": true,
      "using_filesort": true,
      "cost_info": {
        "sort_cost": "1.76"
      },
      "nested_loop": [
        {
          "table": {
            "table_name": "cscart_categories",
            "access_type": "ALL",
            "possible_keys": [
              "PRIMARY",
              "c_status",
              "p_category_id"
            ],
            "rows_examined_per_scan": 40,
            "rows_produced_per_join": 1,
            "filtered": "4.00",
            "cost_info": {
              "read_cost": "4.54",
              "eval_cost": "0.16",
              "prefix_cost": "4.70",
              "data_read_per_join": "6K"
            },
            "used_columns": [
              "category_id",
              "storefront_id",
              "usergroup_ids",
              "status"
            ],
            "attached_condition": "((`gaseus`.`cscart_categories`.`storefront_id` in (0,1)) and ((`gaseus`.`cscart_categories`.`usergroup_ids` = '') or (0 <> find_in_set(0,`gaseus`.`cscart_categories`.`usergroup_ids`)) or (0 <> find_in_set(1,`gaseus`.`cscart_categories`.`usergroup_ids`))) and (`gaseus`.`cscart_categories`.`status` in ('A','H')))"
          }
        },
        {
          "table": {
            "table_name": "cscart_products_categories",
            "access_type": "ref",
            "possible_keys": [
              "PRIMARY",
              "pt"
            ],
            "key": "PRIMARY",
            "used_key_parts": [
              "category_id"
            ],
            "key_length": "3",
            "ref": [
              "gaseus.cscart_categories.category_id"
            ],
            "rows_examined_per_scan": 110,
            "rows_produced_per_join": 1,
            "filtered": "1.00",
            "index_condition": "(`gaseus`.`cscart_products_categories`.`product_id` in (10706,10707,10708,10709,10710,10711,10712,10713,10714,10715,10716,10717,10718,10719,10720,10721,10722,10723,10724,10725,10726,10727,10728,10729,10730,10731,10732,10733,10734,10735,10736,10737,10738,10739,10740,10741,10742,10743,10744,10745,10746,10747,10748,10749,10750,10751,10752,10753,10754,10755,10756,10757,10758,10759,10880,10881,10882,10883,10884,10885,10886,10887,10888,10889,10890,10891,10892,10893,10894,10895,10896,10897,10898,10921,10922,10923,10924,10925,10926,10927,10928,10929,10930,10931,10932,10933,10934,10935,10936,10937,10938,10939,10940,10941,10942,10943))",
            "cost_info": {
              "read_cost": "44.00",
              "eval_cost": "0.18",
              "prefix_cost": "66.30",
              "data_read_per_join": "28"
            },
            "used_columns": [
              "product_id",
              "category_id",
              "link_type"
            ]
          }
        },
        {
          "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",
              "gaseus.cscart_products_categories.product_id"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 1,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "0.44",
              "eval_cost": "0.18",
              "prefix_cost": "66.92",
              "data_read_per_join": "28"
            },
            "used_columns": [
              "product_id",
              "category_id",
              "position"
            ]
          }
        }
      ]
    }
  }
}

Result

product_id category_ids position
10706 306M
10707 306M
10708 306M
10709 306M
10710 306M
10711 306M
10712 306M
10713 306M
10714 306M
10715 306M
10716 306M
10717 306M
10718 306M
10719 306M
10720 306M
10721 306M
10722 306M
10723 306M
10724 306M
10725 306M
10726 306M
10727 306M
10728 306M
10729 306M
10730 306M
10731 306M
10732 306M
10733 306M
10734 306M
10735 306M
10736 306M
10737 306M
10738 306M
10739 306M
10740 306M
10741 306M
10742 306M
10743 306M
10744 306M
10745 306M
10746 306M
10747 306M
10748 306M
10749 306M
10750 306M
10751 306M
10752 306M
10753 306M
10754 306M
10755 306M
10756 306M
10757 306M
10758 306M
10759 306M
10880 306M
10881 306M
10882 306M
10883 306M
10884 306M
10885 306M
10886 306M
10887 306M
10888 306M
10889 306M
10890 306M
10891 306M
10892 306M
10893 306M
10894 306M
10895 306M
10896 306M
10897 306M
10898 306M
10921 306M
10922 306M
10923 306M
10924 306M
10925 306M
10926 306M
10927 306M
10928 306M
10929 306M
10930 306M
10931 306M
10932 306M
10933 306M
10934 306M
10935 306M
10936 306M
10937 306M
10938 306M
10939 306M
10940 306M
10941 306M
10942 306M
10943 306M