A couple of things you can try.
- Replace on conflict do update with a separate update in a cte then the insert.
- IIRC postgres isn't able to parallelise inserts so if you re-write your update/insert to have consistent sorting on the PK and a way to select non conflicting batches (modulo on the pk) you should be able to kick off inserts in parallel from an application or script.