UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IpENYnBfD7zDfaPNZzx01EvlWE8bA0ndVvmG4R0fUA0='
WHERE
key_id = '0449c2332e6944584dedb6e21e85d084bbc32556bdae66b083bd911686ffcb76'
AND (
token = 'IpENYnBfD7zDfaPNZzx01EvlWE8bA0ndVvmG4R0fUA0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)