UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QkHAJNOb5w4+PsZWSNbkitPNJby0G/G5rZ5P8WcWZIY='
WHERE
key_id = 'cf45fd3bb27e18594b1f64c91e8cffbfc0cb320bfa8adf6477cfed653789c720'
AND (
token = 'QkHAJNOb5w4+PsZWSNbkitPNJby0G/G5rZ5P8WcWZIY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)