I’ve found the answer in the DHS ESTA FAQ. The bad news is that if you renew your passport, you have to re-apply (and pay again) for a new ESTA:
What should I do if the information on my passport has changed?
If you obtain a new passport or there is a change to your passport information, you must apply for a new travel authorization and pay the associated fees.
There are a few things that you can update about your ESTA without having to re-apply, but they aren’t passport related. The list is:
Credit:stackoverflow.com‘