UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KxMfDSExBOOs44QlsWvu3zp9tn9/JHCQigrO6DEkF5U='
WHERE
key_id = '95a86efdf060e2f56c2958429b156d7be22d406801263dbf228a85e841709b3b'
AND (
token = 'KxMfDSExBOOs44QlsWvu3zp9tn9/JHCQigrO6DEkF5U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)