Allright, after digging & debugging a bit further into this issue I found it out myself!
'expiryDate' => Template::raw('<a href='.$entry->cpEditUrl.'>'.$entry->title.'</a>')
PS: don't forget to add this to the top of your php file:
There isn't really enough information here to give a full answer, but 'Bad Request Unable to verify your data submission' means that Craft is not getting supplied the correct CSRF token.
To confirm, try turning off CSRF protection in your config: