so because your ssh connection got kicked out it exited all the app’s while they were running.
This means Pacman left if’s lock file in place. If you are sure the other instance of pacman exited you can manually remove the lock file with sudo rm /var/lib/pacman/db.lck
then run the updates to sync the DB files. sudo pacman -Syu
I would advise checking out screen to avoid these issues with ssh getting booted out in the future.