SELECT 
  category_id 
FROM 
  cscart_categories 
WHERE 
  id_path REGEXP '(^|/)302(/|$)'

Query time 0.00026

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "3.27"
    },
    "table": {
      "table_name": "cscart_categories",
      "access_type": "ALL",
      "rows_examined_per_scan": 26,
      "rows_produced_per_join": 26,
      "filtered": "100.00",
      "cost_info": {
        "read_cost": "0.68",
        "eval_cost": "2.60",
        "prefix_cost": "3.28",
        "data_read_per_join": "81K"
      },
      "used_columns": [
        "category_id",
        "id_path"
      ],
      "attached_condition": "regexp_like(`kcoffee`.`cscart_categories`.`id_path`,'(^|/)302(/|$)')"
    }
  }
}

Result

category_id
302
311
312
313