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 (
    53, 54, 55, 57, 58, 59, 60, 61, 62, 63, 64, 
    65, 66, 69, 70, 71, 72, 73, 74, 75, 76, 
    77, 78, 80, 81, 82, 83, 84, 85, 86, 87, 
    88, 89, 90, 91, 92, 94, 95, 96, 97, 98, 
    99, 100, 101, 102, 103, 104, 105, 106, 
    107, 108, 109, 110, 111, 112, 113, 114, 
    115, 116, 117, 118, 119, 120, 121, 122, 
    123, 124, 125, 126, 127, 128, 129, 130, 
    131, 132, 133, 134, 135, 136, 137, 138, 
    139, 140, 141, 142, 143, 144, 145, 146, 
    147, 148, 149, 150, 151, 152, 154
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.00263

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": 97,
      "filtered": 100,
      "index_condition": "cscart_products_categories.product_id in (53,54,55,57,58,59,60,61,62,63,64,65,66,69,70,71,72,73,74,75,76,77,78,80,81,82,83,84,85,86,87,88,89,90,91,92,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,154)"
    },
    "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
53 18M
54 16M
55 9M
57 12M
58 12M
59 9M
60 20M
61 21M
62 9M
63 18M
64 18M
65 12M
66 9M
69 13M
70 9M
71 10M
72 10M
73 23M
74 20M
75 20M
76 6M
77 24M
78 10M
80 9M
81 9M
82 9M
83 10M
84 10M
85 10M
86 13M
87 9M
88 10M
89 13M
90 9M
91 9M
92 9M
94 9M
95 9M
96 9M
97 6M
98 10M
99 10M
100 10M
101 9M
102 23M
103 6M
104 10M
105 10M
106 9M
107 23M
108 9M
109 9M
110 9M
111 9M
112 9M
113 25M
114 25M
115 26M
116 26M
117 26M
118 26M
119 9M
120 9M
121 9M
122 9M
123 9M
124 9M
125 9M
126 9M
127 9M
128 9M
129 9M
130 9M
131 9M
132 9M
133 9M
134 9M
135 9M
136 9M
137 9M
138 9M
139 9M
140 9M
141 9M
142 6M
143 6M
144 6M
145 6M
146 9M
147 9M
148 9M
149 9M
150 9M
151 12M
152 9M
154 10M