UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rIqRF0Caf/jnZ6pcbfm1XyrkHInlx+dAThHCIj262Tg='
WHERE
key_id = 'c5ea409b5493f21e76a249cac59c28d93d1b6c9268adbd05566dffb9702edacb'
AND (
token = 'rIqRF0Caf/jnZ6pcbfm1XyrkHInlx+dAThHCIj262Tg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)