Running two DELETE statements causes a syntax error
You can't* combine multiple queries like this.  You need to execute them separately.

When you see the error ...the right syntax to use near... that's telling you that MySQL's parser (lexer?) can't come up with any valid reason why it found whatever it's complaining about in the specific place within the statement where it was encountered... in this case, the beginning of a second query.

You'll need to send them to the server separately.

If these two deletions need to occur together, atomically, that should be handled in a transaction.



*"can't" -- actually, with some libraries, you can enable multi-statement execution, but don't do that. It opens up a whole new world of sql injection vulnerabilities.