The group $\mathbb{Z}_{31}$ has an automorphism group of order $30$, given by sending $1$ to any integer between $1$ and $31$; this corresponds to the multiplicative group of invertible elements modulo $31$. This is well-known to be cyclic.
You want an automorphism of order $5$ to correspond to the action of $\mathbb{Z}_5$. Either a bit of trial and error, or knowing that $2^5=32\equiv 1\pmod{31}$ will tell you that the automorphism of $\mathbb{Z}_{31}$ given by multiplication-by-$2$ has order $5$. The other automorphisms of order $5$ are then multiplication-by-$4$, multiplication-by-$8$, and multiplication-by-$16$ (since any nontrivial element of the cyclic group of order $5$ will generate the group). It is clear that the automorphism $\phi$ that your first formula is using is the latter, multiplication-by-$16$. So $\phi(a)$ at $y$ evaluates to "multiply $y$ by $16$ and do this $a$ times", resulting in $16^ay$, taken modulo $31$.
Note that your second formula is using muliplicative notation for your groups, but $\mathbb{Z}_{31}$ and $\mathbb{Z}_5$ are groups under addition. The formula, translated into additive notation, should be (translated into your notation, with by the way is not very good...)
$$(cl_{31}(x),cl_5(a)) \cdot (cl_{31}(y),cl_5(b)) = \bigl(cl_{31}(x)+\phi(cl_5(a))(cl_{31}(y)),cl_5(a+b)\bigr)$$
Note that you could have used any of the order $5$ automorphisms of $\mathbb{Z}_{31}$. Although the formula will be different (replacing $16^a$ with either $2^a$, $4^a$, or $8^a$), the resulting groups are all isomorphic to each other.