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 (
    82071, 82118, 82073, 82038, 149042, 
    82061, 81948, 82101, 82009, 81647, 
    82133, 82103, 81737, 81655, 82104, 
    81704, 81826, 81863, 81741, 81860, 
    81702, 82072, 81634, 81657, 81739, 
    81625, 82115, 81776, 82074, 81611, 
    81862, 81627, 82114, 82069, 81817, 
    81773, 81636, 81812, 81624, 81806, 
    82099, 82052, 81756, 81816, 82096, 
    81814, 81747, 81768, 82116, 82095, 
    81672, 81764, 81765, 81762, 81766
  ) 
GROUP BY 
  cscart_products_categories.product_id

Query time 0.00144

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "89.09"
    },
    "grouping_operation": {
      "using_filesort": false,
      "nested_loop": [
        {
          "table": {
            "table_name": "cscart_products_categories",
            "access_type": "range",
            "possible_keys": [
              "PRIMARY",
              "link_type",
              "pt"
            ],
            "key": "pt",
            "used_key_parts": [
              "product_id"
            ],
            "key_length": "3",
            "rows_examined_per_scan": 55,
            "rows_produced_per_join": 55,
            "filtered": "100.00",
            "using_index": true,
            "cost_info": {
              "read_cost": "12.09",
              "eval_cost": "11.00",
              "prefix_cost": "23.09",
              "data_read_per_join": "880"
            },
            "used_columns": [
              "product_id",
              "category_id",
              "link_type"
            ],
            "attached_condition": "(`webmarco`.`cscart_products_categories`.`product_id` in (82071,82118,82073,82038,149042,82061,81948,82101,82009,81647,82133,82103,81737,81655,82104,81704,81826,81863,81741,81860,81702,82072,81634,81657,81739,81625,82115,81776,82074,81611,81862,81627,82114,82069,81817,81773,81636,81812,81624,81806,82099,82052,81756,81816,82096,81814,81747,81768,82116,82095,81672,81764,81765,81762,81766))"
          }
        },
        {
          "table": {
            "table_name": "cscart_categories",
            "access_type": "eq_ref",
            "possible_keys": [
              "PRIMARY",
              "c_status",
              "p_category_id"
            ],
            "key": "PRIMARY",
            "used_key_parts": [
              "category_id"
            ],
            "key_length": "3",
            "ref": [
              "webmarco.cscart_products_categories.category_id"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 2,
            "filtered": "5.00",
            "cost_info": {
              "read_cost": "55.00",
              "eval_cost": "0.55",
              "prefix_cost": "89.09",
              "data_read_per_join": "16K"
            },
            "used_columns": [
              "category_id",
              "usergroup_ids",
              "status",
              "storefront_id"
            ],
            "attached_condition": "((`webmarco`.`cscart_categories`.`storefront_id` in (0,1)) and ((`webmarco`.`cscart_categories`.`usergroup_ids` = '') or find_in_set(0,`webmarco`.`cscart_categories`.`usergroup_ids`) or find_in_set(1,`webmarco`.`cscart_categories`.`usergroup_ids`)) and (`webmarco`.`cscart_categories`.`status` in ('A','H')))"
          }
        }
      ]
    }
  }
}

Result

product_id category_ids
81611 2905M
81624 2904M
81625 2904M
81627 2904M
81634 2904M
81636 2904M
81647 2904M
81655 2904M
81657 2904M
81672 2800M
81702 2904M
81704 2904M
81737 2904M
81739 2904M
81741 2904M
81747 2904M
81756 2694M
81762 2694M
81764 2694M
81765 2694M
81766 2694M
81768 2694M
81773 2904M
81776 2904M
81806 2850M
81812 2850M
81814 2850M
81816 2850M
81817 2850M
81826 2904M
81860 2904M
81862 2904M
81863 2904M
81948 2904M
82009 2904M
82038 2904M
82052 2904M
82061 2904M
82069 2904M
82071 2904M
82072 2904M
82073 2904M
82074 2904M
82095 2904M
82096 2904M
82099 2904M
82101 2904M
82103 2904M
82104 2904M
82114 2904M
82115 2904M
82116 2904M
82118 2904M
82133 2904M
149042 2904M