UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8TxkP1NYRim5cw9w3g09juwRP+6pC+aI5vxxpcrGJhc='
WHERE
key_id = 'bce6e007fe5d10cc3ae181a6b8b9321a9619ba8dfc0c2019e457b3446cefcd96'
AND (
token = '8TxkP1NYRim5cw9w3g09juwRP+6pC+aI5vxxpcrGJhc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)