UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'q96IFBUwQy6EISTU9VMWjr6m0BB0IM7xyAZhWLOrSKc='
WHERE
key_id = '391e6e455427dbe938eda5c727841e8aaf5e9d41febd7c0c11a1115519eec8e3'
AND (
token = 'q96IFBUwQy6EISTU9VMWjr6m0BB0IM7xyAZhWLOrSKc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)