Calculate expire close to the lock time as possible.