UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bO0IloV8PHpKVON7OjonFvwrINQ9lmKTyPpKjv6ktlY='
WHERE
key_id = 'deb7eb6bb2f287be79dcf80abe79b26356f8b84c958876d0d0b92491bbc28aef'
AND (
token = 'bO0IloV8PHpKVON7OjonFvwrINQ9lmKTyPpKjv6ktlY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)