First make sure the clock and date is correct, as encryption and signatures rely on time a lot to verify validity.
Update archlinux-keyring
first, alone: sudo pacman -Sy archlinux-keyring
. Unless that system is incredibly old, this should fix the "corrupted" packages issue.
Then, for safety's sake, get yourself a copy of pacman-static or an arch install USB. If something goes wrong midway with regular pacman, it may not run again because of mixed old/new libraries due to partial upgrade, but pacman-static can be used as a standalone in-system backup option, as it doesn't depend on anything.
wget https://pkgbuild.com/~morganamilo/pacman-static/x86_64/bin/pacman-static
chmod a+x pacman-static
Check the news on archlinux.org and see if there's any manual steps your system might need.
And finally, refresh and update everything: sudo pacman -Syu
.
Fix any errors that comes up but with a bit of luck everything will install fine. If something fails during installation, your system may be borked but pacman-static should continue working, so try to fix it with that. If all else fails, use the arch USB to fix it.
Good luck!