In Convex Optimization by Boyd, it is stated that
Since any linear program is therefore a convex optimization problem, we can consider convex optimization to be a generalization of linear programming.
An optimization problem is called linear, if the objective and constraint functions are all linear, i.e. satisfy
$f_i(\alpha x + \beta y) = \alpha f_i(x) + \beta f_i(y)$ for all $x, y \in \mathbb{R}^n$, and all $\alpha, \beta \in \mathbb{R}$.
A convex optimization is one where the objective and constraint functions are convex, they satisfy
$f_i(\alpha x + \beta y) \leq \alpha f_i(x) + \beta f_i(y)$ for all $x, y \in \mathbb{R}^n$, and all $\alpha, \beta \in \mathbb{R}$ with $\alpha + \beta = 1, \alpha \geq 0, \beta \geq 0$.
How are linear programs having $\alpha, \beta$ not in this range say $4, 6$ respectively also convex?
Convex optimization problem states that we just have to check the condition for $\alpha, \beta$ nonnegative and sums to $1$.
For linear function, we have to check all the real $\alpha, \beta$. Since it holds for any $(\alpha, \beta) \in \mathbb{R}^2$, it will hold when there is a restriction as well.