UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8WhoRcOGCJyLMbe1KL8eI/ARDt02sT61G6JgGT8K1iU='
WHERE
key_id = '0f3d4538cad3b203502c1106defa8d00b18ccc8c7c3bc5d91dfa34bce12400e3'
AND (
token = '8WhoRcOGCJyLMbe1KL8eI/ARDt02sT61G6JgGT8K1iU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)