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 (
    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.00087

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": 49,
      "filtered": 100,
      "attached_condition": "cscart_products_categories.product_id in (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)",
      "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": ["vietpom_dev.cscart_products_categories.category_id"],
      "rows": 1,
      "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')"
    }
  }
}

Result

product_id category_ids
67 32,33,31M
77 34,35,11M
78 34,35,11M
82 34,35,11M
83 34,43,11M
84 34,35,11M
85 34,35,11M
89 37M
92 34,35,11M
142 39M
164 77M
165 39,77M
192 88M
193 88M
194 88M
195 88M
198 88M
199 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