UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '19p99Nx1o3+p3Ww1w73y3NzclbZSYtFqz+pT/BYlY9o='
WHERE
key_id = '45f6ffcbd0301f09743a2d57bcdc348d3584be30b6779c4d3ea86c5ebf769070'
AND (
token = '19p99Nx1o3+p3Ww1w73y3NzclbZSYtFqz+pT/BYlY9o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)