UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3lNQsm1KxgxnCsiJSFuAirnv2lm8srZgdRR+8oX8M9Q='
WHERE
key_id = 'f20fb7801c89b3ed2159fc76e614c45f61c1abd75b87599b65e886a6cd048c52'
AND (
token = '3lNQsm1KxgxnCsiJSFuAirnv2lm8srZgdRR+8oX8M9Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)