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 
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') 
WHERE 
  cscart_products_categories.product_id IN (
    10982, 10983, 10978, 10996, 10995, 10993, 
    11008, 11033, 11032, 11031, 11034, 
    11028, 11029, 11027, 11107, 11106, 
    11105, 11104, 11122, 11121, 11133, 
    11135, 11140, 11139, 11142, 11141, 
    11356, 11357, 11358, 11359, 11464, 
    11466, 11468, 11549, 11554, 11556, 
    11550, 11552, 11553, 11557, 11558, 
    11568, 11569
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.00116

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "156.36"
    },
    "grouping_operation": {
      "using_filesort": false,
      "nested_loop": [
        {
          "table": {
            "table_name": "cscart_products_categories",
            "access_type": "range",
            "possible_keys": [
              "PRIMARY",
              "pt"
            ],
            "key": "pt",
            "used_key_parts": [
              "product_id"
            ],
            "key_length": "3",
            "rows_examined_per_scan": 182,
            "rows_produced_per_join": 182,
            "filtered": "100.00",
            "index_condition": "(`softwarepirmam_hewadelivard_cscart_4`.`cscart_products_categories`.`product_id` in (10982,10983,10978,10996,10995,10993,11008,11033,11032,11031,11034,11028,11029,11027,11107,11106,11105,11104,11122,11121,11133,11135,11140,11139,11142,11141,11356,11357,11358,11359,11464,11466,11468,11549,11554,11556,11550,11552,11553,11557,11558,11568,11569))",
            "cost_info": {
              "read_cost": "74.46",
              "eval_cost": "18.20",
              "prefix_cost": "92.66",
              "data_read_per_join": "2K"
            },
            "used_columns": [
              "product_id",
              "category_id",
              "link_type"
            ]
          }
        },
        {
          "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": [
              "softwarepirmam_hewadelivard_cscart_4.cscart_products_categories.category_id"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 9,
            "filtered": "5.00",
            "cost_info": {
              "read_cost": "45.50",
              "eval_cost": "0.91",
              "prefix_cost": "156.36",
              "data_read_per_join": "28K"
            },
            "used_columns": [
              "category_id",
              "storefront_id",
              "usergroup_ids",
              "status"
            ],
            "attached_condition": "((`softwarepirmam_hewadelivard_cscart_4`.`cscart_categories`.`storefront_id` in (0,1)) and ((`softwarepirmam_hewadelivard_cscart_4`.`cscart_categories`.`usergroup_ids` = '') or (0 <> find_in_set(0,`softwarepirmam_hewadelivard_cscart_4`.`cscart_categories`.`usergroup_ids`)) or (0 <> find_in_set(1,`softwarepirmam_hewadelivard_cscart_4`.`cscart_categories`.`usergroup_ids`))) and (`softwarepirmam_hewadelivard_cscart_4`.`cscart_categories`.`status` in ('A','H')))"
          }
        }
      ]
    }
  }
}

Result

product_id category_ids
10978 664M
10982 664M
10983 664M
10993 664M
10995 664M
10996 664M
11008 664M
11027 664M
11028 664M
11029 664M
11031 664M
11032 664M
11033 664M
11034 664M
11104 664M
11105 664M
11106 664M
11107 664M
11121 664M
11122 664M
11133 664M
11135 664M
11139 664M
11140 664M
11141 664M
11142 664M
11356 664M
11357 664M
11358 664M
11359 664M
11464 664M
11466 664M
11468 664M
11549 664M
11550 664M
11552 664M
11553 664M
11554 664M
11556 664M
11557 664M
11558 664M
11568 664M
11569 664M