UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0pkjxn7QHi9trbf61WFJBM36WEnfi48jQVYoekkUSuU='
WHERE
key_id = 'd2eba81a401a47ed6f3cc71eb2125ce6f2cfd6b2c65580fb5c77963aed2cc9aa'
AND (
token = '0pkjxn7QHi9trbf61WFJBM36WEnfi48jQVYoekkUSuU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)