UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8///tQJ3BilzXm+gHgDtm13XNtvvZ3sgwuMfeEX1fF4='
WHERE
key_id = '605d5f138e73f8e3ada71ac64c77fcff85ef256c1e4f94658bd81fefbb4d49c3'
AND (
token = '8///tQJ3BilzXm+gHgDtm13XNtvvZ3sgwuMfeEX1fF4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)