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 (
    11225, 11306, 11446, 11472, 11508, 11086, 
    11126, 11291, 11337, 11348, 11411, 
    11531, 11166, 11477, 11167, 11256, 
    11309, 11430, 11479, 11600, 11362, 
    11414, 11520, 11128, 11535, 11633, 
    11199, 11390, 11399, 11530, 11236, 
    11289, 11462, 11136, 11193, 11352, 
    11458, 11267, 11293, 11308
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.00157

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "220.41"
    },
    "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": 263,
            "rows_produced_per_join": 263,
            "filtered": "100.00",
            "index_condition": "(`softwarepirmam_hewadelivard_cscart_4`.`cscart_products_categories`.`product_id` in (11225,11306,11446,11472,11508,11086,11126,11291,11337,11348,11411,11531,11166,11477,11167,11256,11309,11430,11479,11600,11362,11414,11520,11128,11535,11633,11199,11390,11399,11530,11236,11289,11462,11136,11193,11352,11458,11267,11293,11308))",
            "cost_info": {
              "read_cost": "102.06",
              "eval_cost": "26.30",
              "prefix_cost": "128.36",
              "data_read_per_join": "4K"
            },
            "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": 13,
            "filtered": "5.00",
            "cost_info": {
              "read_cost": "65.75",
              "eval_cost": "1.32",
              "prefix_cost": "220.41",
              "data_read_per_join": "41K"
            },
            "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
11086 664M
11126 664M
11128 664M
11136 664M
11166 664M
11167 664M
11193 664M
11199 664M
11225 664M
11236 664M
11256 664M
11267 664M
11289 664M
11291 664M
11293 664M
11306 664M
11308 664M
11309 664M
11337 664M
11348 664M
11352 664M
11362 664M
11390 664M
11399 664M
11411 664M
11414 664M
11430 664M
11446 664M
11458 664M
11462 664M
11472 664M
11477 664M
11479 664M
11508 664M
11520 664M
11530 664M
11531 664M
11535 664M
11600 664M
11633 664M