Either write your own session serialiser to allow you to serialise datetime objects directly, or store the datetime value in some other form.
If you want to save it as seconds, then use the datetime.timestamp() method:
request.session[social_ticketing_cookie_name(request.event)] = {
    'code': code, 
    'expiry_date': expiry_date.timestamp()
}
Your own SESSION_SERIALIZER class only needs to provide loads and dumps methods, directly analogous to json.loads() and json.dumps() (which is how the standard JSON serializer is implemented).
If you want to encode datetime objects and be able to transparently turn those back into datetime objects again, I'd use a nested object format to flag such values as special:
from datetime import datetime
class JSONDateTimeSerializer:
    @staticmethod
    def _default(ob):
        if isinstance(ob, datetime):
            return {'__datetime__': ob.isoformat()}
        raise TypeError(type(ob))
    @staticmethod
    def _object_hook(d):
        if '__datetime__' in d:
            return datetime.fromisoformat(d['__datetime__'])
        return d
    def dumps(self, obj):
        return json.dumps(
            obj, separators=(',', ':'), default=self._default
        ).encode('latin-1')
    def loads(self, data):
        return json.loads(
            data.decode('latin-1'), object_hook=self._object_hook
        )
and set SESSION_SERIALIZER to the full qualified name of the above module (path.to.module.JSONDateTimeSerializer).
The above uses the datetime.fromisoformat() method, new in Python 3.7.