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 (
    449431, 449270, 449272, 449290, 449318, 
    449330, 449341, 449357, 449173, 449180, 
    449188, 449225, 449250, 449259, 449083, 
    449116, 448973, 448976, 448981, 448994, 
    448864, 448865, 448874, 448890, 448920, 
    448947, 448955, 448773, 448808, 448826, 
    448827, 448830, 448854, 448666, 448707, 
    448732, 448738, 448743, 448749, 448572, 
    448581, 448596, 448614, 448643, 448467, 
    448480, 448483, 448492, 448501, 448534, 
    448544, 448556, 448366, 448416, 448426, 
    448430, 448446, 448265, 448300, 448310, 
    448314, 448329, 448333, 448348, 448349, 
    448162, 448196, 448198, 448216, 448236, 
    448252, 448255, 448259, 448070, 448084, 
    448121, 448141, 448150, 448158, 447976, 
    447990, 447998, 448009, 448015, 448042, 
    447863, 447887, 447891, 447927, 447950, 
    447951, 447767, 447785, 447845, 447859, 
    447661
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.00088

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost": 0.321518524,
    "nested_loop": [
      {
        "table": {
          "table_name": "cscart_products_categories",
          "access_type": "range",
          "possible_keys": ["PRIMARY", "pt"],
          "key": "pt",
          "key_length": "3",
          "used_key_parts": ["product_id"],
          "loops": 1,
          "rows": 96,
          "cost": 0.1728812,
          "filtered": 100,
          "attached_condition": "cscart_products_categories.product_id in (449431,449270,449272,449290,449318,449330,449341,449357,449173,449180,449188,449225,449250,449259,449083,449116,448973,448976,448981,448994,448864,448865,448874,448890,448920,448947,448955,448773,448808,448826,448827,448830,448854,448666,448707,448732,448738,448743,448749,448572,448581,448596,448614,448643,448467,448480,448483,448492,448501,448534,448544,448556,448366,448416,448426,448430,448446,448265,448300,448310,448314,448329,448333,448348,448349,448162,448196,448198,448216,448236,448252,448255,448259,448070,448084,448121,448141,448150,448158,447976,447990,447998,448009,448015,448042,447863,447887,447891,447927,447950,447951,447767,447785,447845,447859,447661)",
          "using_index": true
        }
      },
      {
        "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": ["u985510652_ecartify.cscart_products_categories.category_id"],
          "loops": 96,
          "rows": 1,
          "cost": 0.08668544,
          "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
447661 289M
447767 498M
447785 498M
447845 289M
447859 500M
447863 495M
447887 498M
447891 498M
447927 500M
447950 495M
447951 289M
447976 500M
447990 498M
447998 495M
448009 495M
448015 305M
448042 289M
448070 305M
448084 495M
448121 305M
448141 305M
448150 500M
448158 305M
448162 500M
448196 305M
448198 500M
448216 500M
448236 305M
448252 495M
448255 495M
448259 305M
448265 495M
448300 498M
448310 500M
448314 500M
448329 498M
448333 500M
448348 305M
448349 289M
448366 498M
448416 500M
448426 495M
448430 495M
448446 498M
448467 498M
448480 498M
448483 495M
448492 305M
448501 498M
448534 498M
448544 500M
448556 498M
448572 495M
448581 500M
448596 495M
448614 495M
448643 500M
448666 500M
448707 498M
448732 305M
448738 495M
448743 498M
448749 498M
448773 500M
448808 498M
448826 498M
448827 498M
448830 498M
448854 305M
448864 500M
448865 305M
448874 500M
448890 500M
448920 500M
448947 500M
448955 305M
448973 495M
448976 495M
448981 305M
448994 289M
449083 498M
449116 305M
449173 500M
449180 289M
449188 305M
449225 495M
449250 500M
449259 498M
449270 305M
449272 289M
449290 495M
449318 500M
449330 305M
449341 498M
449357 498M
449431 498M