UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gXAgmOWeYJWWSDDJcavR4sn8gcfvIlB3d9P1GuzwY2Y='
WHERE
key_id = 'ac14fd2c8f3edfff7ce5b5ad109f93c32944dfc1b9d4e5df06f463dd6856dbcf'
AND (
token = 'gXAgmOWeYJWWSDDJcavR4sn8gcfvIlB3d9P1GuzwY2Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)