UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KFXlUobWKnrWTWdkyrFgjeemj/JKgk5SGDnkgqOyEa0='
WHERE
key_id = 'a3dd3e5147250a12687de9bd1fc8b9f3f244765f6563cb03a1d9dd60540e0b4b'
AND (
token = 'KFXlUobWKnrWTWdkyrFgjeemj/JKgk5SGDnkgqOyEa0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)