Optimising a MySQL script with 1.7 billion records
Several thoughts and requests.  (Not yet a complete answer.)

Please provide SHOW CREATE TABLE, at least for daily_stats_zone_unique_device_uuids_per_hour.  How many partitions in that table.

I assume it is practical and possible to migrate a few rows at a time, as long as we don't mess up the ids, either the old ids or the new ids.

We should walk through the main table, 1000 rows at a time, probably by the PRIMARY KEY. (I may choose to modify this advice after seeing the CREATE TABLE, especially the partition definition.)

It would involve finding all the ids and changing them for the batch.  Possibly add a "sleep" between iterations.

Do the batch as a single transaction. -- The time it takes for the transaction to run becomes the length of the "downtime".  Adjust the "1000" and the "sleep" time to avoid interfering too much with the rest of the system.

1.7 B rows in that table?  What about the other tables?

A technique that may be useful:  Adjust all the ids by N, where N is big enough to "shift" all the values to a currently-unused range of values in the ids.

I see UUIDs.  How pervasive are they?  How big is innodb_buffer_pool_size?  How much RAM?  How big (in GB) is the dataset?  I ask these because UUIDs are notoriously inefficient when the index becomes bigger than can be cached; I worry that you are already there.  The first thing to help with this will be to change the 1000 to, say, 100.  This is because (in the 'worst' case) nearly every read will have to go to disk because of the randomness of UUIDs.

You say there are a bunch of indexes; I assume they are not UNIQUE?

In the SELECT...

Isn't (CASE WHEN id!=0 THEN id ELSE 0 END) the same as IFNULL(id, 0)?

7 tables are mentioned, we can't see which tables some of the SELECT values come from (eg first_seen).  Do you really need all the LEFT JOINs?

What is the relevance of the SELECT to the merging of two tables?  Isn't there an issue of shifting some ids?

More discussion of chunking: http://mysql.rjweb.org/doc.php/deletebig#deleting_in_chunks