UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xprnC1gutbjC+jmAuGio2W4RfeI0bak/3Vy27m3lQmU='
WHERE
key_id = 'ab5c74f4da88859558341095d3e1abd74c6cb715f758f0e99bf073f8d6e1fa31'
AND (
token = 'xprnC1gutbjC+jmAuGio2W4RfeI0bak/3Vy27m3lQmU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)