Optimal control of stochastic differential equations with dynamical boundary conditions