UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wxJeB79G8FEhmoIrSO4WKc4vWil50+pJ1ETaSGkNdas='
WHERE
key_id = 'e670aad99631ec72d2fc82b559e50522df224bbfa28de4a214cd25767b871887'
AND (
token = 'wxJeB79G8FEhmoIrSO4WKc4vWil50+pJ1ETaSGkNdas='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)