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.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 (
    200, 201, 202, 203, 204, 205, 206, 207, 
    208, 209, 190, 210, 211, 212, 213, 214, 
    215, 216, 217, 218, 219, 191, 220, 221, 
    222, 223, 224, 225, 226, 227, 228, 229, 
    192, 230, 231, 232, 233, 234, 235, 236, 
    237, 238, 239, 193, 240, 241, 242, 243, 
    194, 195, 198, 199, 77, 82, 84, 85, 83, 
    89, 164, 142, 92, 165, 78, 67
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.00132

JSON explain

{
  "query_block": {
    "select_id": 1,
    "filesort": {
      "sort_key": "cscart_products_categories.product_id",
      "temporary_table": {
        "table": {
          "table_name": "cscart_categories",
          "access_type": "index",
          "possible_keys": ["PRIMARY", "c_status", "p_category_id"],
          "key": "c_status",
          "key_length": "909",
          "used_key_parts": ["usergroup_ids", "status", "parent_id"],
          "rows": 54,
          "filtered": 100,
          "attached_condition": "(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')",
          "using_index": true
        },
        "table": {
          "table_name": "cscart_products_categories",
          "access_type": "ref",
          "possible_keys": ["PRIMARY", "pt"],
          "key": "PRIMARY",
          "key_length": "3",
          "used_key_parts": ["category_id"],
          "ref": ["vietpom_dev.cscart_categories.category_id"],
          "rows": 2,
          "filtered": 48.2142868,
          "attached_condition": "cscart_products_categories.product_id in (200,201,202,203,204,205,206,207,208,209,190,210,211,212,213,214,215,216,217,218,219,191,220,221,222,223,224,225,226,227,228,229,192,230,231,232,233,234,235,236,237,238,239,193,240,241,242,243,194,195,198,199,77,82,84,85,83,89,164,142,92,165,78,67)"
        }
      }
    }
  }
}

Result

product_id category_ids
67 32,33,31M
77 35,11M,34
78 34,35,11M
82 34,35,11M
83 11M,43,34
84 11M,34,35
85 35,11M,34
89 37M
92 35,11M,34
142 39M
164 77M
165 77M,39
190 88M
191 88M
192 88M
193 88M
194 88M
195 88M
198 88M
199 88M
200 88M
201 88M
202 88M
203 88M
204 88M
205 88M
206 88M
207 88M
208 88M
209 88M
210 88M
211 88M
212 88M
213 88M
214 88M
215 88M
216 88M
217 88M
218 88M
219 88M
220 88M
221 88M
222 88M
223 88M
224 88M
225 88M
226 88M
227 88M
228 88M
229 88M
230 88M
231 88M
232 88M
233 88M
234 88M
235 88M
236 88M
237 88M
238 88M
239 88M
240 88M
241 88M
242 88M
243 88M