UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Wl2hNYvkI2McTj6TRkzUtqVwDBI/7e/IMsdy4c7dUEQ='
WHERE
key_id = 'd283ea4ad8ffb02513dce38eeed4c540ddeb889e9a3ec58288763503b2fd03c8'
AND (
token = 'Wl2hNYvkI2McTj6TRkzUtqVwDBI/7e/IMsdy4c7dUEQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)