First of all, torque is the product of force and the distance of a point from the pivoting point perpendicular to the direction force.So,
$${\tau} = {\vec r}\;×\;{\vec F}$$
$${\tau} = |{\vec r}||{\vec F}|sin{\theta}$$ where ${\theta}$ is the angle between $\vec F$ and $\vec r$.
So, you must first resolve the forces.
Now, for the line of length ${d_1}$ ,
Angle between $\vec {F_1}$ and $\vec r$ is $\alpha$
Component of $\vec {F_1}$ perpendicular to $\vec r $(along $d_1$)=
$${F_1}sin{\alpha}$$
Angle between ${mg}$ and $\vec r$ is $$(90°-\alpha)$$
Component of $mg$ perpendicular to $\vec r$= $$mgcos{\alpha}$$
So, net torque:
$${\tau}= {F_1}{d_1}{sin\alpha}-{m}{g}{cos\alpha}(\frac{d_1}{2})$$
Similarly for the other line of force,
$${\tau}= {F_2}{d_2}{sin\beta}-{m}{g}{cos\beta}(\frac{d_2}{2})$$

Now talking of $2^{nd}$ class lever,
The formula that you have used,i.e.,
$${Effort}×{Effort\;arm}={Load}×{Load\;arm}$$
Only applies for balanced situation (rotational equilibrium).In that case,
$${F_1}{sin\alpha}({d_1})={mg}{cos\alpha}(\frac{d_1}{2})$$
$${F_2}{sin\beta}({d_2})={mg}{cos\beta}(\frac{d_2}{2})$$
But, as you are lifting of the block and rotating it around a pivot point (say anticlockwise), you cannot apply that equation for second class levers as the stick is not in rotational equilibrium. So, in this case(for anticlockwise rotation):
$${F_1}{sin\alpha} > \frac{{mg}{cos\alpha}}{2}$$
(I have cancelled $d_1$ from both sides)
$${F_2}{sin\beta} > \frac{{mg}{cos\beta}}{2}$$
(cancelled $d_2$ from both sides)
$\alpha$ and $\beta$ are going to vary constantly as you lift the block. So, you would need exact values to calculate the torque at any instant. But you are going to get the same relation between $F_1$ and $F_2$ at any instant. You need not worry about the second class lever equation as it is just an extrapolation of the balanced torque condition. I hope you have got the idea of how to frame the formulas.