UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OVvG06yxsf4D9r/rQtqC1rxJRzn0Jax3ad8xDmdkkFU='
WHERE
key_id = 'debda4b678aff7ccaf600ab5cb637e14faabf34fdbfdfcfda5c8a6a93c5dd73b'
AND (
token = 'OVvG06yxsf4D9r/rQtqC1rxJRzn0Jax3ad8xDmdkkFU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)