The following is for ArchLinux however applies to other Linux distros too. To correct an invalid KEY one needs to do the following:

rm -fr /etc/pacman.d/gnupg
pacman-key --init
pacman-key --populate archlinux
 Save
say the key throwing an error is in Blackarch then is also needed to :

sudo pacman-key --populate blackarch
 Save
and finally

sudo pacman -Sy archlinux-keyring
sudo pacman-key --populate archlinux
sudo pacman-key --refresh-keys