Update around 200,000 posts

You mentioned setting the memory limits and execution time to unlimited, so this may not be the right answer. I thought I’d mention it anyway since it may help.

Since you have so much content, you’ll have to find ways to accomplish this in the background rather than during the request. This is the perfect situations for scheduled tasks.

This would allow you to schedule an update that will run when cron runs rather than within the scope of the request.

You can also use WP CLI to write a command that will accomplish this. This allows you to run this manually and/or schedule this with cron.

Hope this helps.