DYNAMIC_USE_STATIC_KEY with generated RTC Token (php), javascript, php, token

I have a problem:
I get DYNAMIC_USE_STATIC_KEY in console trying to establish a connection.

2 Tokens which are generated by an Agora Console and rtcTokenBuilder are different, the second is longer, and using it occurs this error. With console Token is everything ok.

Token examples:
Console: 0068bedd2631cf24edea47479b64ad219ceIAAYXDdhxjKQyDWQEoqK0qEiAYo+dLSyd/YNAaflVD4PJO/ZQc0AAAAAEACMMKzfQDg1YAEAAQA/ODVg


rtcTokenBuilder Code snippet:

$appID = "8*************************";
$appCertificate = "+++++++++++++++++++++++++++7";
$channelName = "Test Chamber";
$uid = 0;
$role = RtcTokenBuilder::RoleAttendee;
$expireTimeInSeconds = 300; // 5 min for test purposes
$currentTimestamp = (new DateTime("now", new DateTimeZone('UTC')))->getTimestamp();
$privilegeExpiredTs = $currentTimestamp + $expireTimeInSeconds;
$token = RtcTokenBuilder::buildTokenWithUid($appID, $appCertificate, $channelName, $uid, $role, $privilegeExpiredTs);
echo $token;

js file:

client.join(token, room, 0, (uid) => { // 0 -> uid
    let localStream = AgoraRTC.createStream({
        audio: true,
        video: true
    localStream.init(() => 

client.on("onTokenPrivilegeWillExpire", function(){
        url: tokenGenPath,
        method: "POST",
        success: function(data){
           newToken = data;
        error: function(){

It says here, that I do not provide a Token prior connection: Agora Docs

P.S. I’ve noticed also, if I generate a Token in Agora console for the start and in case of expiration of this Token a new valid Token is generated from rtcTokenBuilder and connection/conversation continues without any errors.

Source: Ask PHP