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 (
    1130, 1131, 1132, 1133, 1135, 1136, 1137, 
    1138, 1139, 1140, 1141, 1142, 1143, 
    1144, 1146, 1147, 1148, 1149, 1150, 
    1151, 1152, 1153, 1154, 1155, 1156, 
    1157, 1158, 1159, 1160, 1161, 1162, 
    1163, 1164, 1165, 14, 1256
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.00153

JSON explain

{
  "query_block": {
    "select_id": 1,
    "table": {
      "table_name": "cscart_products_categories",
      "access_type": "range",
      "possible_keys": ["PRIMARY", "pt"],
      "key": "pt",
      "key_length": "3",
      "used_key_parts": ["product_id"],
      "rows": 37,
      "filtered": 100,
      "index_condition": "cscart_products_categories.product_id in (1130,1131,1132,1133,1135,1136,1137,1138,1139,1140,1141,1142,1143,1144,1146,1147,1148,1149,1150,1151,1152,1153,1154,1155,1156,1157,1158,1159,1160,1161,1162,1163,1164,1165,14,1256)"
    },
    "table": {
      "table_name": "cscart_categories",
      "access_type": "eq_ref",
      "possible_keys": ["PRIMARY", "c_status", "p_category_id"],
      "key": "PRIMARY",
      "key_length": "3",
      "used_key_parts": ["category_id"],
      "ref": ["bacpvdev_db.cscart_products_categories.category_id"],
      "rows": 1,
      "filtered": 100,
      "attached_condition": "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')"
    }
  }
}

Result

product_id category_ids
14 5M
1130 6M
1131 16M
1132 16M
1133 29M
1135 6M
1136 20M
1137 6M
1138 6M
1139 16M
1140 16M
1141 16M
1142 16M
1143 16M
1144 16M
1146 16M
1147 19M
1148 23M
1149 23M
1150 23M
1151 23M
1152 23M
1153 23M
1154 23M
1155 23M
1156 23M
1157 23M
1158 9M
1159 9M
1160 9M
1161 20M
1162 10M
1163 10M
1164 9M
1165 9M
1256 46M