UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eKNdCzNlcKGqnJjZtu31GUYdkeR7FMCp5UQg0OTg0/w='
WHERE
key_id = '88c9896c86eb5945662a3efa96cb072521261e20c890e93161d3ccce39e09fcc'
AND (
token = 'eKNdCzNlcKGqnJjZtu31GUYdkeR7FMCp5UQg0OTg0/w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)