@Michael M has the right answer. A chi-squared test is asymptotically the same as what you would get from a logistic regression model here, although the p-values will typically vary slightly if you don't have infinite data. More technically, the chi-squared test is a score test, whereas the typical tests used with logistic regression models are Wald and likelihood ratio tests (to understand this more fully, it may help to read my answer here: Why do my p-values differ between logistic regression output, chi-squared test, and the confidence interval for the OR?).
However, if you fit a logistic regression model using reference level coding (cf., here), you will prevent the model from recognizing, and taking advantage of, the ordinal nature of age. In your case, the minimum and maximum possible values are bounded, which makes your situation a little simpler. We might guess that the expected value of age within each bin is the mean of the endpoints. So you could just substitute a continuous value for each person in place of their listed age category. That is:
\begin{align}
\{10-20\} \rightarrow 15.5 \\
\{21-30\} \rightarrow 25.5 \\
\{31-40\} \rightarrow 35.5
\end{align}
Then you can use the new continuous age variable in your logistic regression model. People find this surprising, but the potential for error is just $\pm5$, and the range of your data is $30$, so the induced measurement error shouldn't play that big of a role. Note that when people give their actual age (say, $29$), that is also typically a kind of rounded value instead of their exact age (perhaps, $29.2789274$). There are fancier ways to try to deal with this, but I wouldn't typically bother with them.
Here is an example with your sample data, coded in R:
age = c(15.5, 15.5, 25.5, 25.5, 35.5, 35.5)
summary(glm(happy~age, family=binomial))
#
# Call:
# glm(formula = happy ~ age, family = binomial)
#
# Deviance Residuals:
# 1 2 3 4 5 6
# 0.4659 0.4659 0.8350 -1.5640 -1.0061 1.3590
#
# Coefficients:
# Estimate Std. Error z value Pr(>|z|)
# (Intercept) 4.1683 3.8201 1.091 0.275
# age -0.1292 0.1310 -0.986 0.324
#
# (Dispersion parameter for binomial family taken to be 1)
#
# Null deviance: 7.6382 on 5 degrees of freedom
# Residual deviance: 6.4364 on 4 degrees of freedom
# AIC: 10.436
#
# Number of Fisher Scoring iterations: 4