UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hCg0n/oFC8H6LR0MlpFnUna3veU3rJ+d8Sa0OD+CHeE='
WHERE
key_id = 'fba78475151739d7ace519c381bebf6d2ea6df9e320b893494569029e1d5ed4d'
AND (
token = 'hCg0n/oFC8H6LR0MlpFnUna3veU3rJ+d8Sa0OD+CHeE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)