I'm assuming the security key you're referring to is a U2F security key.
U2F has several advantages over other 2FA schemes like OTP, one of the biggest improvements is to prevent the issue you point out. With most 2FA schemes a phisher could simply act as a proxy between you and the legitimate service, and obtain your password and 2FA code that way. U2F prevents this with the help of the browser.
Authentication works as follows: (somewhat simplified)
- The website sends a signature request
- The browser validates that the AppID in the signature request
matches the visited domain (or that the domain is a trusted
facet)
- The browser forwards the signature request to the U2F device
- The device uses the AppID and key handle to retrieve the private key, which it uses to sign the challenge
- The signature gets sent back to the browser, and on to the website to verify it
If a MitM simply acts as a simple proxy this will fail at step 2, as the domain won't match the AppID in the signature request. If the MitM filters the signature request and modifies the AppID to match the phishing domain, it will fail at step 4, as the AppID and key handle no longer specify a valid key.
Of course, the phisher already has your password at this point so you would need to change it, but at least they can't get into your account.