Couple questions:
- What version?
- Has web farms been set up and running well without issue prior to this?
- Do you have Redis cache or sql session setup for the servers?
Part of the problem is there are 30k tasks. The system is trying to sync thoes 30k tasks every time it processes and it fails. So the best thing to do is to clear up those 30k tasks using a sql statement or delete them one by one in the UI.
Next thing to do is verify your web farm is working properly when you make a single or small change. Verify you're change is being synced and it is published when accessing the other server.
Lastly, verify your web farm is configured properly within Kentico and with Redis or SQL session.