It is a total scam. Apple will never send you an email threatening to lock your account if you don't do something. Nor will they ask for you to update personal information by providing a link to do that. They may provide a link to get to the Apple ID page, but that would be it.
You may continue to get these emails for awhile, especially since you actually clicked on one of the links. You can report them by using the link in this support article: https://support.apple.com/en-us/HT204759
Best of luck,
GB