How can I use a MySQL query in an openquery query on Microsoft SQL Server.?
According to the OPENQUERY syntax you'd have to rewrite the script in the following way:

DELETE OPENQUERY (MySQLServer, '
    SELECT sb.*
    FROM stockbatches sb 
    INNER JOIN batchestodelete btd 
    ON sb.batch_batch = btd.batchno 
    AND sb.batch_part = btd.batchpart;
');