UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/4sMGDYJmLRG+zle2PuK/D3FjwTaPkGYNdV42muzwGc='
WHERE
key_id = '3ecdcbc246ea23cfc5ead889a5da4ee6f18a617c5714907a8b43455de6b5f844'
AND (
token = '/4sMGDYJmLRG+zle2PuK/D3FjwTaPkGYNdV42muzwGc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)