Purge old binlogs in mysql 4
The error message says right syntax to use near 'BINARY LOGS TO 'mysql-bin.xxx' but you mentioned use of PURGE MASTER LOGS TO ...?

Try using PURGE MASTER LOGS TO mysql-bin.xxx instead of using 'PURGE BINARY ....' as the latter was added to MySQL v4.1.1 and if your version is any lower, PURGE BINARY ... won't work.