As per this article If you can't sign in with two-step verification using your Apple ID - Apple Support
As long as you remember your Apple ID password and still have access to one of your trusted devices, you can sign in and create a new Recovery Key.
- Go to your Apple ID account page.
- Sign in with your password and trusted device.
- In the Security section, click Edit > Replace Lost Key.
Keep your new Recovery Key in a safe place. Your old Recovery Key won't work anymore and you can't use it to reset your password or access your account.
As noted above, two-step verification requires at least two of the items below to sign in successfully:
- Your Apple ID password
- Access to one of your trusted devices
- Your Recovery Key
If you've permanently lost any two of these items, you can't sign in or regain access to your account. You'll need to create a new Apple ID. You can create a new one from the Apple ID site.