Remove the database lock: sudo rm /var/lib/pacman/db.lck
If you get: cannot remove ‘/var/lib/pacman/db.lck’: No such file or directory; use this: sudo rm /var/tmp/pamac/dbs/db.lck
Its also possible that you have corrupted database files. sudo rm /var/lib/pacman/sync/*.*
will remove them, then refresh the database’s to replace them.
Not sure, but removing and replacing the databases is a first step to see if it fixes the issue. Its possible your mirror list has you occasionally connecting to a mirror with issues.